ejjrooom

Change name of currently downloading file

3 posts in this topic

Attempting to change the name of a file being currently downloaded doesn't seem to stick. However, I can change the name before the file has started downloading, or if it is not currently being downloaded.

In Queue.xml I can see that there's a Download node for each file, with attributes Target="PathFile name" and TempTarget="PathFile name.TTH.dctmp". If a file has not started downloading, moving/renaming it would mean Target and TempTarget have the same path/file name string. But once a file has started downloading but is now stopped, moving renaming it makes the strings differ (as expected). In this case, once the file has been downloaded it is then moved/renamed as required.

If so, then why can't the same be allowed when a file is currently being downloaded? In this case too surely Queue.xml can be modified and the file can be moved/renamed after the download has completed?

Share this post


Link to post
Share on other sites

I am not completely sure what it is that you are asking here, as to why the temporary file is not moved/renamed when file is downloading that is because while file is downloading the temporary file will be locked (ie. it can not be moved), and once the download compeletes the temp file is no more, so no action is needed.

Share this post


Link to post
Share on other sites

What I'm asking for is simple. After TempTarget is done downloading, it is moved/renamed to Target. Note that both TempTarget and Target can refer to the same location, in which case the only result would be that File name.TTH.dctmp is renamed to File name.

Thing is, Target can apparently only be changed when the download is not currently underway. Attempting to move/rename a file currently being downloaded does not change Target in Queue.xml at all. My question is, why this sort of restriction? A file's TempTarget won't change, but why can't its Target be changed midway through a download? Why should you need to stop the download in order to do this? In any case the actual renaming/moving will only happen at the end of the download (obviously), so what's the problem with changing the final path/file name string in the XML during the download?

There, did I explain the problem properly? Hope you understood what I am trying to say...

Share this post


Link to post
Share on other sites