View previous topic :: View next topic |
Author |
Message |
ChrisFontenot13
Joined: 11 Nov 2004 Posts: 7 Location: Lafayette, LA
|
Posted: Thu Aug 30, 2007 4:18 pm Post subject: Is there a way to test "file in use"? |
|
|
I have some scripts that rely on being able to open files in a directory sequentially... is there any way to have Vegas 7.0 detect when a file is already open by another program (such as if it is being encoded/trancoded into the directory by another process)? Otherwise it throws an error when it tries to open it and drops an error.
I managed to hack some bits together that tests to see if the file contains a video stream and if that stream isn't there, move right along, but this seems clunky. Any ideas? |
|
Back to top |
|
 |
Edward Troxel Site Admin
Joined: 14 Jul 2004 Posts: 5476
|
Posted: Thu Aug 30, 2007 5:42 pm Post subject: |
|
|
Put it in a try - catch. Then when you try to open the file, if you can't you could output a message saying which file(s) couldn't be opened (if you wanted) but at least processing could continue. |
|
Back to top |
|
 |
ChrisFontenot13
Joined: 11 Nov 2004 Posts: 7 Location: Lafayette, LA
|
Posted: Thu Aug 30, 2007 7:00 pm Post subject: |
|
|
That's basically what I'm doing right now (if it catches the file existing without a video stream, it throws an error).
It seems strange to me that I couldn't find a simple "File In Use" test in the API somewhere, rather than having to open the file, test for a video stream, etc. Then again there might be one and I didn't see it... or there might be one and it's undocumented. You used to be able to use OpenProject to open a video file (Vegas 4), but that wasn't documented either.
Otherwise, I could set up the machines to not encode into those directories, but that would require some re-writes I don't know if I have time for right now. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB 2.0.11 © 2001, 2002 phpBB Group
|