Hello,
I want to automatically upload completed downloads to a ftp location using a script. If I have a TR_TORRENT_DIR that is fine, I can iterate over that directory and upload all files - but what should I do if the torrent has no directory, but is a "one-filer"?
To answer this question myself, I tried finding the location of your repository, but could not find it anywhere.
https://gist.github.com/janlimpens/5798379
Doubt about env variables upon completed download
-
- Posts: 552
- Joined: Sun Dec 13, 2009 10:44 pm
Re: Doubt about env variables upon completed download
As far as I know the DIR-variable is the name of the base directory the torrent was saved to (so could contain data from several other torrents), while the NAME-variable is the name of the file (if one-filer) or the directory (if multiple) of the torrent itself. So the simple solution is to check if NAME is a file or directory and then continue appropriately. The DIR-variable should always be a directory btw.
Re: Doubt about env variables upon completed download
Ah, so TR_TORRENT_DIR would always be $HOME/Downloads in the default case?
Re: Doubt about env variables upon completed download
I updated the gist to reflect this... Let's see if this works...
https://gist.github.com/janlimpens/5799506
https://gist.github.com/janlimpens/5799506