Reading only filenames
Hey. i'm working with JPG's here and they are constantly being edited yada yada yada... what i need to know is a way to read the filename so i can detect its format, yada yada, and move the file where desired. program to run in the background.
anyway, thanks in adavance for any help.
Which Operating system and compiler?
Are you wanting to get a directory listing at periodic intervals for example?
i use an old borland turbo IDE compiler+debugger. and i'm looking at anything that runs with dos 7 (win98) and up. command line or otherwise. anything to get the job done.
to have it periodically do whats needed is ok. but what would be nice is to have it idle and wait for a file to be loaded.
then work its magic.
what is needed of this program is to read the file name, determine its format, then sort into folders by certain points in the file name. ex. file name is WWWWXXXXXYYYZZa.jpg or WWWWXXXXXZZa.jpg i need to sort the files by 'WWWW'
then by 'ZZ'
Get a better compiler then - that old crusty thing is no good for writing modern programs capable of taking advantage of all that your OS has to offer.
Dev-C++ is a good bet.
While you're downloading: FAQ: Accessing a directory and all the files within it
You could also do what you want with a batch file.
Or if you want to get advanced, then use change notifications
Or you could use the windows scheduler to run your program every 5 minutes say, and it just does a one-time scan of the directory and does whatever work is necessary.
how about this...? how do i get a filename stored into a string so i can write the program to determin that file 0034xxxxxyyy.jpg needs to go into folder 34 and move it?
Well the FAQ quoted by codeplug would show you that.