Hi
How can I do the following using C in UNIX.
I need to search a directory for a file and open that file.
The directory will contain log files and some other file, that have a file name of:
somename_DTS.log, DTS being date time stamp (20040429104607) when the file was created.
the only thing that is different between the log file names is the DTS.
What I need to do is to get the name of the newest file in the directory.
Is there anything in UNIX that I could use in my C program to find the newest file
and get its name. Or do I have to load all the files into an array than sort it and get the newest file name that way.
files that match
Thank you
How can I do the following using C in UNIX.
I need to search a directory for a file and open that file.
The directory will contain log files and some other file, that have a file name of:
somename_DTS.log, DTS being date time stamp (20040429104607) when the file was created.
the only thing that is different between the log file names is the DTS.
What I need to do is to get the name of the newest file in the directory.
Is there anything in UNIX that I could use in my C program to find the newest file
and get its name. Or do I have to load all the files into an array than sort it and get the newest file name that way.
files that match
Thank you