PDA

View Full Version : File Existence Check :(



Moni
09-07-2003, 08:57 AM
Hello,

For a portion of my project, I need to check whether there are files (of specific extension) exist in a folder.

Let me explain it by example:

There is a folder name: Prog
I have to check every 10 seconds, is there any p01.cpp file or not?
There may be multiple files..........

p02.cpp
p03.cpp
p04.cpp

And I have to get the name of all of the files that comes in that folder in every 10 seconds.

And after that I have compile each of them and save the result like

p02.txt
p03.txt
p04.txt

etc.

Then I'll remove the file from that folder so that it can't be in the list of compilations while those are already done :)

It will be better if the code can be written in C++ the compiler I am using is Borland C++ 5.02 and the bcc for file compiling.

I'll redirect the compilation result in that p02.txt...............then guys :)

Hammer
09-07-2003, 05:25 PM
Try adapting one of these (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046380353&id=1044780608) examples to read a directory.

Also, here's some sleep (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1045967760&id=1043284392) info.