| | |
can we read folders using C program?
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
the <dirent.h> library has the following functions
http://www.opengroup.org/onlinepubs/.../dirent.h.html
if you're confined to Windows-specific solutions, theres an implementation of this for Windows
http://www.gimp.org/~tml/gimp/win32/dirent.zip
if that's not acceptable for homework purposes, then maybe you can just get away with a system call like
.
c Syntax (Toggle Plain Text)
int closedir(DIR *); DIR *opendir(const char *); struct dirent *readdir(DIR *); int readdir_r(DIR *, struct dirent *, struct dirent **); void rewinddir(DIR *); void seekdir(DIR *, long int); long int telldir(DIR *);
if you're confined to Windows-specific solutions, theres an implementation of this for Windows
http://www.gimp.org/~tml/gimp/win32/dirent.zip
if that's not acceptable for homework purposes, then maybe you can just get away with a system call like
strcpy(myBigString, system("dir"));.
Last edited by jephthah; May 30th, 2008 at 5:59 pm.
It would be best to let us know what O/S and compiler you are using so we don't have to guess, as jephthah was forced to do. They all have different ways to accomplish the task.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
![]() |
Similar Threads
- Set, View, Change, or Remove Special Permissions for Files and Folders in Windows XP (Windows tips 'n' tweaks)
- hijackthis log... what to delete?? (Viruses, Spyware and other Nasties)
- Help HELP! I can't access any folders like my documents and C: drive and Control Pa.. (Viruses, Spyware and other Nasties)
- toolbars, read-only folders, and mysterious exe's OH MY! (Viruses, Spyware and other Nasties)
- Please read this hijack log and advise (Viruses, Spyware and other Nasties)
- Network Error unable to read url from host g.msn.com (Viruses, Spyware and other Nasties)
- Network error unable to read url from host g.msn.com: connection reset by peer (Viruses, Spyware and other Nasties)
- WinXP and IE problems. Please Read. (Web Browsers)
Other Threads in the C Forum
- Previous Thread: importing data from file into multi-dimensional array
- Next Thread: How to access mobile phone through USB cable from Turbo C
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays bash binarysearch centimeter char convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic fflush file fork frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hardware highest homework i/o ide inches infiniteloop initialization interest kilometer km lazy linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling segmentationfault send shape single socketprograming socketprogramming spoonfeeding stack standard strchr string strings structures suggestions system systemcall test testautomation unix user voidmain() wab win32api windows.h






