C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 10th, 2013, 12:11 PM
hola2 hola2 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 3 hola2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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...

Reply With Quote
  #2  
Old February 10th, 2013, 01:06 PM
tredway tredway is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 4 tredway User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #3  
Old February 10th, 2013, 02:15 PM
salem's Avatar
salem salem is offline
Contributed User
Click here for more information
 
Join Date: Jun 2005
Posts: 3,836 salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 153 Folding Title: Novice Folder
Time spent in forums: 2 Months 3 Weeks 2 Days 16 h 15 m 5 sec
Reputation Power: 1774
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper

Reply With Quote
  #4  
Old February 10th, 2013, 02:49 PM
dwise1_aol's Avatar
dwise1_aol dwise1_aol is offline
Contributing User
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 6,125 dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 3 Days 16 h 57 m 4 sec
Reputation Power: 1949
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.

Reply With Quote
  #5  
Old February 10th, 2013, 03:58 PM
hola2 hola2 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 3 hola2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #6  
Old February 10th, 2013, 04:00 PM
hola2 hola2 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 3 hola2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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"

Reply With Quote
  #7  
Old February 10th, 2013, 05:03 PM
dwise1_aol's Avatar
dwise1_aol dwise1_aol is offline
Contributing User
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 6,125 dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 14th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 3 Days 16 h 57 m 4 sec
Reputation Power: 1949
And did you try the other options? Should have been ls -l main. The main thing is to check the permissions of main.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Plz help me, got stock !!

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap