![]() |
X Terminal- Maemo Nokia N900
Hi guys. So I got one problem which I cannot solve myself anymore.
I was trying to do programing in my "new" mobile phone Nokia N900 which runs on Maemo 5 (Linux-based). Firstly I was following guides how to install GCC on it and I was successful because I installed it and you run it as : gcc-4.2 <source code> or g++-4.2 <source code> so I made myself a really noobish program just to try how it works. I work in C so this was the source: #include <stdio.h> int main() { int i; for(i=0; i<10; i++) printf("Hello, world\n"); return 0; } just simple hello world. So and where is the problem. I wrote this source by "nano" which i also installed but just by simple method (Maemo "app store" and just downloaded nano program) so no intricate methods. Okey I used nano and wrote this code. I saved it as prog.c Now as in Ubuntu (I got some beginner skills from programing in ubuntu so this is why im putting question) i used gcc to compile it so gcc-4.2 prog.c as in Ubuntu it made for me "a.out". and now. the problem is clear. When i do ---> ./a.out it returns me: /bin/sh: ./a.out: Permission denied and I REALLY DON'T KNOW what to do with that problem. I hope you guys can solve this problem. Thanks a lot in advance :cool: |
Re: X Terminal- Maemo Nokia N900
You have to set the file to be executable:
chmod +x a.out and try again. |
Re: X Terminal- Maemo Nokia N900
What herderp says, as well as making sure your code is not located under MyDocs, for that is a FAT partition and as such you won't be able to set permissions there.
|
Re: X Terminal- Maemo Nokia N900
herpderp no change. I did the command you have written but no change. But I also do:
sudo gainroot so I think I have root permission but I don't know where is the problem. In normal Linux (Ubuntu for example) you don't need to do such things so Im wondering why it do not work here. And anthonie, what do you mean by your reply? I got it saved in MyDocs ... you mean like that i couldn't have saved it in MyDocs or what?? |
Re: X Terminal- Maemo Nokia N900
Holy bible,
Save it in /home/user/ or anywhere except for /home/user/MyDocs/ and its sub-directories. Basically ~/MyDocs is a FAT partition on which chmod permissions don't take effect so you can't place it there ;) |
Re: X Terminal- Maemo Nokia N900
Man I got it even without using chmod. Thanks alot. But I'll be grateful if you can explain me why it was not working when I got the "a.out" in MyDocs???
Thanks |
Re: X Terminal- Maemo Nokia N900
Quote:
|
Re: X Terminal- Maemo Nokia N900
But in what is different for example FAT to NTFS or even to Linux EXT4. why you cannot set permission in FAT... this is question
|
Re: X Terminal- Maemo Nokia N900
Quote:
|
Re: X Terminal- Maemo Nokia N900
Quote:
FAT was the file system used by MS-DOS (an operating system that was widely used in the 80s, still around in some form or another). FAT (or MS-DOS) did not have a concept of file permissions or file ownership (contrary to Unix, another OS-family from the 70s). For various reasons[*], FAT (in one its incarnations, namely FAT32) has become a sort of de-facto standard for drives containing data which you expect to exchange with other computers/devices (think digital cameras, USB sticks, the works). That's why the biggest partition of your N900 is formatted as FAT (feel free to repartition your N900 once you feel more comfortable with it). [*] There is a GOOD reason to use FAT/VFAT/FAT32: namely because it doesn't support any kind of file permissions. In many cases this is desirable. Try to set-up a shared folder/partition on a Windows or Linux system, i.e. one where two users can both read and write from and to *every* file and directory. You won't manage with NTFS or any Linux file system. I can't believe why there's still no proper "modern" file system with an option for completely ignoring permissions. Many times I have been tempted to patch ext4 to add a fstab-option precisely for that, but in the end I choose to postpone the whole issue. |
Re: X Terminal- Maemo Nokia N900
Thanks. And... Is there any advantage of using FAT then? Or to ask that way, why can be no permission allowed desirable??
|
Re: X Terminal- Maemo Nokia N900
The advatange of MyDocs being FAT, is that you can plug your n900 into your computer via USB and read the partition on Windows.
|
Re: X Terminal- Maemo Nokia N900
..so in short one can say the usage of FAT is for compatibility and historic reasons, not because it's a good choice. There are other portable & matured filesystems which are robust but a) could not be extorted by patents and b) have to be included in vanilla Windows. (btw: can we say "Window", now that Win 8 jumped on the full-screen apps train too? Or "Fensterl 8" in .AT)
|
Re: X Terminal- Maemo Nokia N900
Quote:
P.S.: sorry to be annoying for someone maybe, but i just want to have it clear in my mind :) |
Re: X Terminal- Maemo Nokia N900
Google is your friend, if you're looking for knowledge...
http://en.wikipedia.org/wiki/Comparison_of_file_systems |
Re: X Terminal- Maemo Nokia N900
Quote:
|
Re: X Terminal- Maemo Nokia N900
Quote:
Plus, Linux generally only supports reading from NTFS, but not writing. Yes, there are drivers allowing writing, but it's not 100% reliable (I guess they emulate Windows just a bit too much :). Plus, you want a USB stick (and MyDocs is just that) to work with all sorts of exotic devices, such as a TV, or an Android phone, or whatever, which probably only supports FAT32. Plus, MyDocs/USB-stick are supposed to be used for exchanging data. Meaning you don't want any sort of file/directory permissions to ruin that "experience". This is, IMHO, the single most reasonable reason why VFAT/FAT32 is still so widespread. |
Re: X Terminal- Maemo Nokia N900
Quote:
|
Re: X Terminal- Maemo Nokia N900
One correction. Files from FAT-filesystem can be executed (in general). If you check /etc/fstab on N900, you can see a row:
Quote:
|
Re: X Terminal- Maemo Nokia N900
Also getting rid of the "noexec," you should change the fmask to 0000 so all files with have the +x bit set.
Just don't accidentally run a text file as they too will be +x. |
| All times are GMT. The time now is 05:58. |
vBulletin® Version 3.8.8