Jump to content
garf

Linux subprocess question

Recommended Posts

I want to check if an external movie file is being used by another process before continuing with a script.

If I run this in the terminal it returns 1 (which I think is correct as it is being used by rv)

lsof -t /mydirectory/mymovie.mov | wc -w

 

if I run this in a python script in houdini it returns 0.
subprocess.call(' lsof -t /mydirectory/mymovie.mov | wc -w', shell=True)

Any idea as to why this is the case?

Truth be told - I don't really know what I'm doing here.....

 

 

Share this post


Link to post
Share on other sites

for future reference this does work:

subprocess.check_output('/usr/sbin/lsof -t /mydirectory/mymovie.mov | wc -w', shell=True)

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×