www.jetdv.com Forum Index Edward Troxel
Vegas Scripting and Newsletters
Home of Excalibur and Montage Magic
 
 FAQ   Search   Memberlist   Usergroups   Register   Profile 
 Log in to check your private messagesLog in to check your private messages   Log inLog in 

Is there a way to test "file in use"?

 
Post new topic   Reply to topic    www.jetdv.com Forum Index -> Scripting FAQ
View previous topic :: View next topic  
Author Message
ChrisFontenot13



Joined: 11 Nov 2004
Posts: 7
Location: Lafayette, LA

PostPosted: Thu Aug 30, 2007 4:18 pm    Post subject: Is there a way to test "file in use"? Reply with quote

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
View user's profile Send private message Visit poster's website
Edward Troxel
Site Admin


Joined: 14 Jul 2004
Posts: 5475

PostPosted: Thu Aug 30, 2007 5:42 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
ChrisFontenot13



Joined: 11 Nov 2004
Posts: 7
Location: Lafayette, LA

PostPosted: Thu Aug 30, 2007 7:00 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.jetdv.com Forum Index -> Scripting FAQ All times are GMT
Page 1 of 1

 
Jump to:  
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