Hi
I have written a c# command line program to do some post download stuff, nothing fancy. One of the things I want to do is rename the folder ,ex "Colombiana 2011 US UNRATED BluRay 1080p DTS x264 CHD" to "Colombiana (6.7, 123min, 1080p)".
This is do with Directory.Move(src, dst) but this throws an exception saying that the folder is used by another process. Is it the sabnzbd process that keeps a lock on the folder when it starts the post processing script?
Regards
/Kim, Sweden
Cannot rename downloded folder
Re: Cannot rename downloded folder
No, SABnzbd doesn't lock the folder.
In fact the "current directory" is below the actual folder.
However, Windows is rather anal-retentive about renaming folders.
If it so much thinks another process uses it, you cannot rename.
We had to add an option to disable SABnzbd own renaming (__unpack__ prefix)
just to work-around this. Windows Home Server is particularly bad with this.
Moving the folder content might be easier to accomplish.
In fact the "current directory" is below the actual folder.
However, Windows is rather anal-retentive about renaming folders.
If it so much thinks another process uses it, you cannot rename.
We had to add an option to disable SABnzbd own renaming (__unpack__ prefix)
just to work-around this. Windows Home Server is particularly bad with this.
Moving the folder content might be easier to accomplish.
Re: Cannot rename downloded folder
I thought about moving the content to a new folder with my desired name (like you suggested) but this will leave me with a bunch of orphaned empty directories. Small problem but still, a thorn i my side!, want this script to be 100% unattended.
Re: Cannot rename downloded folder
You can add a end-of-queue script to remove all empty folders.
Re: Cannot rename downloded folder
Nice, didn't know there was such a thing! will look in to that, thanks!