![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why not a segmentation fault?? | lagigliaivan | High Level Programming | 22 | 05-21-2008 12:07 PM |
| Segmentation Fault | compbug | UNIX for Dummies Questions & Answers | 3 | 04-21-2006 11:43 AM |
| segmentation fault | wojtyla | High Level Programming | 3 | 02-19-2005 02:53 PM |
| Segmentation fault | jshaulis | AIX | 1 | 06-01-2004 05:16 PM |
| segmentation fault | omran | High Level Programming | 2 | 08-01-2003 09:19 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi! segmentation fault
I have written a program which takes a directory as command line arguments and displays all the dir and files in it.
I don't know why I have a problem with the /etc directory.It displays all the directories and files untill it reaches a sub directory called peers which is in /etc/ppp/peers.the output stops there and says "segmentation fault".I don't know why I have this problem.Any help is greatly appreciated.Thank you. |
|
||||
|
Most C compilers are going to issue errors/warnings with your code. You have some problems. First suggestion to fix one issue - #include <limits.h> Usually dealing with full filenames means declare your strings like this with PATH_MAX Code:
char mydir[PATH_MAX]={0x0};
Plus, what you're doing is far easier with ftw() - see man ftw |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|