The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> C Programming
|
Plz help me, got stock !!
Discuss Plz help me, got stock !! in the C Programming forum on Dev Shed. Plz help me, got stock !! C programming forum discussing all C derivatives, including C#, C++, Object-C, and even plain old vanilla C. These languages are low level languages, and used on projects such as device drivers, compilers, and even whole computer operating systems.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

February 10th, 2013, 12:11 PM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 3
Time spent in forums: 21 m 15 sec
Reputation Power: 0
|
|
|
Plz help me, got stock !!
Hi guys,
I have 2 c program file, one of them is the main, and the other is
data_file.txt . I'm using Linux computer, and cant run the program.
first, I put both files in my home, then I wrote this:
./main data_file.txt
but everytime I get this commment:
permission denied.
plz hellllllllllllllllllllllp...
|

February 10th, 2013, 01:06 PM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 4
Time spent in forums: 1 h 58 m 43 sec
Reputation Power: 0
|
|
can you please be more specific about your problem?
describe it in a way so that others can understand what you want to tell.
by the way, if a file has .txt extension that means it is a TEXT file, not a C program file.
|

February 10th, 2013, 02:15 PM
|
 |
Contributed User
|
|
|
|
|

February 10th, 2013, 02:49 PM
|
 |
Contributing User
|
|
Join Date: Jan 2003
Location: USA
|
|
Quote: | Originally Posted by hola2 Hi guys,
I have 2 c program file, one of them is the main, and the other is
data_file.txt . I'm using Linux computer, and cant run the program.
first, I put both files in my home, then I wrote this:
./main data_file.txt
but everytime I get this commment:
permission denied.
plz hellllllllllllllllllllllp... |
A second C source file would not have a file extension of .txt, which instead is for text files. Do you instead mean that your program will read in that text file?
I assume that you invoked gcc like this:
gcc main.c -o main
If not, then just what is that file main supposed to be?
When you run ls -a main (as I recall; if -a is wrong then somebody please correct), what are the permissions that ls displays for main? In particular, what are the execute permission? Commonly, after creating an executable you need to run chmod on it to add the executable permissions -- again, I'm working from memory here so if I got that wrong, somebody else please correct.
|

February 10th, 2013, 03:58 PM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 3
Time spent in forums: 21 m 15 sec
Reputation Power: 0
|
|
Thanks alot for your reply,
actually my problem is that Im not familiar with c and dont have any basics on it, therefore I dont know exactly what is the "main" file for and what is the "data_file.txt" for !?
But, I guess that the "main" contain the program and the other is just data.
what I know that both of them are one program which is 100% correct and in some way it should work cause some other persons could run it 
|

February 10th, 2013, 04:00 PM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 3
Time spent in forums: 21 m 15 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by dwise1_aol A second C source file would not have a file extension of .txt, which instead is for text files. Do you instead mean that your program will read in that text file?
I assume that you invoked gcc like this:
gcc main.c -o main
If not, then just what is that file main supposed to be?
When you run ls -a main (as I recall; if -a is wrong then somebody please correct), what are the permissions that ls displays for main? In particular, what are the execute permission? Commonly, after creating an executable you need to run chmod on it to add the executable permissions -- again, I'm working from memory here so if I got that wrong, somebody else please correct. |
ls -a main
this give me "main"
|

February 10th, 2013, 05:03 PM
|
 |
Contributing User
|
|
Join Date: Jan 2003
Location: USA
|
|
|
And did you try the other options? Should have been ls -l main. The main thing is to check the permissions of main.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|