Need Help with VBS program timing problem. (Windows 2000) 
Author Message
 Need Help with VBS program timing problem. (Windows 2000)

I have a program process that puts video files in a directory
c:\parkpics\pictures on a one per second basis.  I have a VBS program
that on an hourly basis executes a RENAME DIRECTORY followed by a MAKE
DIRECTORY c:\parkpics\MMDDHH so as to have just 3600 files in each
directory.  (the new
directories are named MMDDHH for the month/day/hour the RENAME
occurred.)  

This is all working pretty well,  but about 1 in 20 times,  the rename
process fails because the video input process happens to be writing its
once-per-second video file to the c:\parkpics\pictures at the same
instant that the RENAME DIRECTORY command is issued by the VBS program.  

Questions:
1) Is there a way for me to test for busy and LOCK the
c:\parkpics\pictures   directory,  execute the RENAME DIRECTORY in VBS
and
then UNLOCK the directory so the input process cannot interfere with the
rename process?  (The input process ignores errors and just "drops a
file
on the floor" if it encounters a busy and this is OK for my
application.)
or
2) Is there something else that I might do to fix this?

Thanks
Joe Mehaffey
--
Got a Question about GPS technology?  Looking for a GPS FAQ site?
See:   http://www.*-*-*.com/



Tue, 31 Aug 2004 13:33:17 GMT  
 Need Help with VBS program timing problem. (Windows 2000)
No code??

I would just check the errorlevel after attempting directory rename; if it isn't 0, it failed, so clear the error and try the rename process again.

: I have a program process that puts video files in a directory
: c:\parkpics\pictures on a one per second basis.  I have a VBS program
: that on an hourly basis executes a RENAME DIRECTORY followed by a MAKE
: DIRECTORY c:\parkpics\MMDDHH so as to have just 3600 files in each
: directory.  (the new
: directories are named MMDDHH for the month/day/hour the RENAME
: occurred.)  
:
: This is all working pretty well,  but about 1 in 20 times,  the rename
: process fails because the video input process happens to be writing its
: once-per-second video file to the c:\parkpics\pictures at the same
: instant that the RENAME DIRECTORY command is issued by the VBS program.  
:
: Questions:
: 1) Is there a way for me to test for busy and LOCK the
: c:\parkpics\pictures   directory,  execute the RENAME DIRECTORY in VBS
: and
: then UNLOCK the directory so the input process cannot interfere with the
: rename process?  (The input process ignores errors and just "drops a
: file
: on the floor" if it encounters a busy and this is OK for my
: application.)
: or
: 2) Is there something else that I might do to fix this?
:
: Thanks
: Joe Mehaffey
: --
: Got a Question about GPS technology?  Looking for a GPS FAQ site?
: See:  http://joe.mehaffey.com



Tue, 31 Aug 2004 20:15:53 GMT  
 Need Help with VBS program timing problem. (Windows 2000)
Thanks Alex,
That sounds quite logical.  I will give that a try!

Joe Mehaffey
--
Got a Question about GPS technology?  Looking for a GPS FAQ site?
See:  http://joe.mehaffey.com



Tue, 31 Aug 2004 23:53:26 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Query Record Selection display in Another Form

2. need help writing server monitor script for windows 2000 and win nt 4 using wsh

3. Visual Basic 3 program printing problems under Windows 2000

4. installing vb program in Windows NT, Windows 2000

5. VB exe not working on Windows 2000 (Please need help)

6. VBS and Windows 2000 Question

7. Modifying windows 2000 user accounts using VBS

8. Difficult Query

9. how can i disable the ctrl break

10. VBA problems Going from Windows 98 to Windows 2000

11. ADO Help doesn't appear (Access 2000, Windows 2000)

12. Word 2000 from within VB: Windows 2000: error, Windows ME: ok

 

 
Powered by phpBB® Forum Software