Active Topics

 


Reply
Thread Tools
Posts: 7 | Thanked: 8 times | Joined on Feb 2013
#1
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
 

The Following User Says Thank You to Holy bible For This Useful Post:
Posts: 329 | Thanked: 422 times | Joined on Feb 2011 @ derpton
#2
You have to set the file to be executable:

chmod +x a.out

and try again.
 

The Following 3 Users Say Thank You to herpderp For This Useful Post:
Posts: 1,048 | Thanked: 1,127 times | Joined on Jan 2010 @ Amsterdam
#3
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.
 

The Following 2 Users Say Thank You to anthonie For This Useful Post:
Posts: 7 | Thanked: 8 times | Joined on Feb 2013
#4
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??
 

The Following User Says Thank You to Holy bible For This Useful Post:
Moderator | Posts: 6,215 | Thanked: 6,400 times | Joined on Nov 2011
#5
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
 

The Following User Says Thank You to thedead1440 For This Useful Post:
Posts: 7 | Thanked: 8 times | Joined on Feb 2013
#6
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
 

The Following User Says Thank You to Holy bible For This Useful Post:
Posts: 1,163 | Thanked: 1,873 times | Joined on Feb 2011 @ The Netherlands
#7
Originally Posted by anthonie View Post
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
__________________
N900 loaded with:
CSSU-T (Thumb)
720p recording,
Pierogi, Lanterne, Cooktimer, Frogatto
N9 16GB loaded with:
Kernel-Plus
--
[TCPdump & libpcap | ngrep]
--
donate
 

The Following 2 Users Say Thank You to mr_pingu For This Useful Post:
Posts: 7 | Thanked: 8 times | Joined on Feb 2013
#8
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
 

The Following User Says Thank You to Holy bible For This Useful Post:
Posts: 1,048 | Thanked: 1,127 times | Joined on Jan 2010 @ Amsterdam
#9
 

The Following User Says Thank You to anthonie For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#10
Originally Posted by Holy bible View Post
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.
 

The Following 7 Users Say Thank You to reinob For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 07:08.