y500 / libtorrent

Automatically exported from code.google.com/p/libtorrent
0 stars 0 forks source link

torrent_handle::rename_file does not save the new name if the file does not exist (in trunk) #710

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
scenario:

After metadata was received my client checks every filename for invalid 
characters and replaces them bye calling rename_file on the torrent_handle.
This does no longer work because it seems the file has to exist to be renamed 
(get a new name).
Is there a new way to change the names of none existent files for a torrent or 
is this a bug?

MassaRoddel

Original issue reported on code.google.com by webmas...@massaroddel.de on 23 Dec 2014 at 2:33

GoogleCodeExporter commented 8 years ago
what error code do you get exactly? in default_storage::rename_file() there is 
a test to ignore boost::system::errc::no_such_file_or_directory (and clear the 
error variable if that's the failure). Is there another error code I should 
check on windows?

Original comment by arvid.no...@gmail.com on 25 Dec 2014 at 8:02

GoogleCodeExporter commented 8 years ago
Further investigation showed that the actual problem is caused by my invalid 
save path (to prevent file creation before metadata gets checked). So the error 
is path not found - not file not found.
I think I can handle this case in my client. Although I think it should still 
be possible to set new filenames.

Original comment by webmas...@massaroddel.de on 25 Dec 2014 at 10:25

GoogleCodeExporter commented 8 years ago
would this patch work?

http://dpaste.com/0QJWPRK

Original comment by arvid.no...@gmail.com on 26 Dec 2014 at 7:43

GoogleCodeExporter commented 8 years ago
it looks like you would have this same problem in 1.0.x though, unless I'm 
misunderstanding what's failing.

Original comment by arvid.no...@gmail.com on 26 Dec 2014 at 1:27

GoogleCodeExporter commented 8 years ago
This patch works for me.

Original comment by webmas...@massaroddel.de on 26 Dec 2014 at 4:08

GoogleCodeExporter commented 8 years ago
fixed in [10637].

Original comment by arvid.no...@gmail.com on 26 Dec 2014 at 9:25