maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   General (https://talk.maemo.org/forumdisplay.php?f=7)
-   -   X Terminal- Maemo Nokia N900 (https://talk.maemo.org/showthread.php?t=89257)

Holy bible 2013-02-22 13:02

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:

herpderp 2013-02-22 13:15

Re: X Terminal- Maemo Nokia N900
 
You have to set the file to be executable:

chmod +x a.out

and try again.

anthonie 2013-02-22 13:24

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.

Holy bible 2013-02-22 14:24

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??

thedead1440 2013-02-22 14:36

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 ;)

Holy bible 2013-02-22 14:54

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

mr_pingu 2013-02-22 15:17

Re: X Terminal- Maemo Nokia N900
 
Quote:

Originally Posted by anthonie (Post 1324426)
for that is a FAT partition and as such you won't be able to set permissions there.

That's the answer to all of your problems, MyDocs being a FAT partition

Holy bible 2013-02-22 16:14

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

anthonie 2013-02-22 16:34

Re: X Terminal- Maemo Nokia N900
 
Quote:

Originally Posted by Holy bible (Post 1324473)
this is question

http://www.urbandictionary.com/define.php?term=J.F.C.

reinob 2013-02-22 20:14

Re: X Terminal- Maemo Nokia N900
 
Quote:

Originally Posted by Holy bible (Post 1324473)
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

What are you, 15 years old or what? :)

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.

Holy bible 2013-02-23 15:06

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??

shawnjefferson 2013-02-23 20:57

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.

don_falcone 2013-02-23 21:41

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)

Holy bible 2013-02-24 01:06

Re: X Terminal- Maemo Nokia N900
 
Quote:

Originally Posted by shawnjefferson (Post 1324679)
The advatange of MyDocs being FAT, is that you can plug your n900 into your computer via USB and read the partition on Windows.

yeah but what about NTFS. it's also readable by windows and it's newer. why not this format for example???

P.S.: sorry to be annoying for someone maybe, but i just want to have it clear in my mind :)

anthonie 2013-02-24 09:13

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

shawnjefferson 2013-02-26 01:50

Re: X Terminal- Maemo Nokia N900
 
Quote:

Originally Posted by Holy bible (Post 1324703)
yeah but what about NTFS. it's also readable by windows and it's newer. why not this format for example???

P.S.: sorry to be annoying for someone maybe, but i just want to have it clear in my mind :)

Probably for many reasons, but I imagine mainly for compatibility reasons first off. If you have ever noticed that almost all USB memory sticks are formated in either FAT or FAT32, depending on their size.

reinob 2013-02-26 09:50

Re: X Terminal- Maemo Nokia N900
 
Quote:

Originally Posted by Holy bible (Post 1324703)
yeah but what about NTFS. it's also readable by windows and it's newer. why not this format for example???

NTFS is R/W under Windows (but not 95 or 98). Plus there are different "revisions" (or versions) of NTFS, so some NTFS features used by Windows Vista (or 7) will not be usable under Windows XP or 2000 or NT, etc.

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.

Holy bible 2013-02-26 19:26

Re: X Terminal- Maemo Nokia N900
 
Quote:

Originally Posted by reinob (Post 1325319)
NTFS is R/W under Windows (but not 95 or 98). Plus there are different "revisions" (or versions) of NTFS, so some NTFS features used by Windows Vista (or 7) will not be usable under Windows XP or 2000 or NT, etc.

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.

Thanks!! Very useful and fulfilling on my question :) thanks once more

AapoRantalainen 2013-03-08 22:54

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:

/dev/mmcblk0p1 /home/user/MyDocs vfat noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortnam e=mixed,dmask=000,fmask=0133,rodir 0
I bolded one parameter to focus.

eccerr0r 2013-03-08 23:12

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