Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make VB4 32bit app watch a folder (hotfolder)

Status
Not open for further replies.

JAFrank

Technical User
Nov 16, 2002
84
US
I am writing a VB app that opens a text file, manipulates the contents a little, and writes out to a new text file. I can make it work perfectly using manual controls, but what I would like to do is have it 'watch' a folder and have it do the conversion on any file that appears in the folder.

Is there an easy way to do this? I'm pretty sure that I can figure out a way to look in the folder every so often, but I can't think of a way to verify that the file has finished being written to the folder, so that my program doesn't try to work with it before it's complete.

Any ideas?

Thanks,

Allen
 
>> Is there an easy way to do this?

Yes, use a timer (control) and check it every n minutes. :)



Thanks,

Michael42
 
Thanks for the reply. I am trying to figure out what would happen if the file were still being written when my program checked the folder? Would it generate an error, or would it try to process the incomplete file?

The file I am processing is created by a "Print to File" process which occurs intermittently throughout the day, and the files are frequently 200 to 500K in size - so they can take several seconds to spool.

Thanks again,

Allen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top