Please send me codes for searching for files in a particular directory which start with a letter say"a".
and also send me code for deleting the contents of the file such found.
thanks nd regards,
ram
Please send me codes for searching for files in a particular directory which start with a letter say"a".
and also send me code for deleting the contents of the file such found.
thanks nd regards,
ram
A C guide:
http://www.acm.uiuc.edu/webmonkeys/book/c_guide/
A list of POSIX functions, which might be useful, if they are available to you.
http://cplus.kompf.de/posixlist_print.html
Logging a directory in Windows.
To delete a file use the DeleteFile() API function.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
>DeleteFile() API function
What's that?
To delete a file use function:
int remove(const char *filename);
from stdio.h
DeleteFile is the Windows API function for deleting a file. In Windows, remove() calls that function.
>>> then why not be more portable and use remove
I did say in my message "if you are using Windows".
If people are working on a particular platform, with no plan to put it on any other, why worry about portability? One could just as well say if remove() is going to call DeleteFile() anyway, why take the overhead of pushing the stack, jumping, then cleaning the stack again?
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.