Cory Posted June 21, 2005 Report Share Posted June 21, 2005 I want to monitor a folder for a new file to appear, when it appears then do somethign with it. Problem is the file name will vary. I tried to do a 'wait for file exist' with "*.*" for the name but that didn't work. Got any great ideas how I can do this? I was thinking I could do a repeat with folder ever 5 seconds with a test or maybe I could do a move with a wildcard to a new known name and use a wait for file exist. I just thought I would ask here first in case you would know. Quote Link to comment Share on other sites More sharing options...
randallc Posted June 22, 2005 Report Share Posted June 22, 2005 Hi, Cory, Tricky, I think. I have no quick answer. I imagine repeat with folder as you say..... What will be your test? 1. just count the number of files and wait till the count is incremented? 2. is the file new, (or just a copy with an old mofified date?), so you can find its name from the most recent file once you know there is an extra one? Good luck; nice to hear how you go? Randall Quote Link to comment Share on other sites More sharing options...
Cory Posted June 22, 2005 Author Report Share Posted June 22, 2005 As it turns out in this case I can make the new file a fixed name but I can think of other places where I might need this. Also in this case I can test to see if the folder is empty and choose not to proceed until it is. But I really like yuor counting idea. My idea was a repeat with folder with a time stamp test. Anything with a new name gets processed. This way I don't have to worry about the new file being in the middle as the folder would be processed alphabeticly. I was just hoping someone might already have a slick routine for this. Quote Link to comment Share on other sites More sharing options...
kevin Posted June 22, 2005 Report Share Posted June 22, 2005 as the folder would be processed alphabeticlyIf you are using the NTFS file system then this is true. If you are using the FAT32 file system then files are processed in a seemingly random order. In fact they are processed in the order that they appear in the directory on the hard drive. NTFS is only available for Windows 2003, XP, 2000 and NT. Windows 98, Me, and 95 always use FAT32. Quote Link to comment Share on other sites More sharing options...
Cory Posted June 22, 2005 Author Report Share Posted June 22, 2005 Really? That's interesting. But luckily I insist all my clients run NTFS so I won't have this problem. Thanks for the heads up though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.