Page 1 of 1

Post Script Cant script created file to completed folder.

Posted: September 4th, 2018, 2:50 pm
by conguero23
I have a simple script where I want to create a file with some info once the file is completed downloading. The issue is it wont write the file and also no error occurs. If I write a folder name of a file that was downloaded previously it works but not the current folder that just downloaded.

import sys, os
folder_name = sys.argv[1]
os.chmod(folder_name, 0o444)
full_path = os.path.join(folder_name, 'myfile.nfo')
f = open(full_path, "w")
sys.exit(0)

Thanks in advance.

Re: Post Script Cant script created file to completed folder.

Posted: September 5th, 2018, 1:43 am
by safihre
Try to debug by adding print statements. For example of your full_path variable.
This also helps to see if the script gets called correctlty.

Re: Post Script Cant script created file to completed folder.

Posted: September 5th, 2018, 9:15 am
by conguero23
Thanks I figured it out. Sab was automatically deleting the file once it was created. I eliminated the extension from the cleanup list and now it works.

Re: Post Script Cant script created file to completed folder.

Posted: September 5th, 2018, 9:25 am
by safihre
Heheh, good boy Sab doing what it was told :p