Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
How to 'chmod' on an NTFS ( or FAT32 ) partition?
Can't make a file executable

i m pretty new to linux and gcc. i have a file1.s file which i tried to build using gcc with following command -

gcc -m32 -o file1 file1.s runtime.c

compilation was successful and i got the file1, but on issuing

./file1

does nothing. when i checked the file permissions, i see that for user, only read and write are enabled, executable is set as -.

i tried doing chmod u+x file1, but that didnt change any permission.

where am i going wrong? how do i execute this file1? it would just print the sum of two numbers.

thanks!

share|improve this question
    
chmod u+x file1 should do the trick. What does ls -l file1 say after you ran chmod u+x file1? –  Florian Diesch Sep 21 '12 at 18:52
    
@FlorianDiesch - it stays the same, that is the execution right is not added even after doing the chmod. –  ubunnttuu Sep 21 '12 at 18:54
2  
What file system are you using? chmod doesn't work on NTFS, FAT ans similar file systems as they do not support Unix permissions. –  Florian Diesch Sep 21 '12 at 19:02
    
ohh... i am using ntfs in that drive..! let me try it out on my ext4.. –  ubunnttuu Sep 21 '12 at 19:04
    
actually i could alter the permission to executable when i copied this file over to my home directory. so chmod worked. i then copied this modified one over to the ntfs folder where all the other files are present, to see if i can execute from there, but now the executable permission is not present. is it like i will never be able to execute this file from that ntfs folder? –  ubunnttuu Sep 21 '12 at 19:08
show 2 more comments

marked as duplicate by Florian Diesch, hbdgaf, hexafraction, Tom Brossman, RolandiXor Sep 22 '12 at 0:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.