Jump to content

Complete support for relative paths


Recommended Posts

hello, last week i posted a issue i was having when using relative paths with utorrent (link), which was fixed by simply changing .\ and ..\ to ./ and ../ but some minor issues remain.

i have a partition dedicated to bittorrent with the following directory structure:

-drive's root







if the partition letter changes (eg. from F: to G:) all the torrents in the list give me a error saying µTorrent cannot find the torrent at F:\utorrent\../torrents/incomplete/file.torrent

if the letter changes back from G: to F: everything works fine again.

this happened to me when i reformatted my HD and the drive letters changed.

also double clicking a file/torrent no longer works, it gives me file not found/opens up C:\

so the way it is now µTorrent is not completely portable cause if i put everything on a usb drive and the drive letter changes between computers the torrents will not resume.

it would be great if µTorrent was completely independent of drive letters.


Link to comment
Share on other sites

  • 2 months later...

You were right Ultima. It was indeed requested earlier.

Really it would be nice if resume.dat doesn't save torrent info with absolute paths. I have µTorrent in G:\Standalone\µTorrent. When I rebooted to Vista, where G:\ is now C:\ drive, µTorrent errored out saying it cannot open G:\Standalone\µTorrent\<Torrent_file_name_here>.

I then had to open resume.dat in Notepad, replace all G:\ to C:\ and force recheck every torrent file via µTorrent to get things working back as usual. This is not real portability is it?

Link to comment
Share on other sites

Think that does the trick. I moved the whole µTorrent to H:\ because H:\ is the same letter for Vista and XP. For the torrents that I did recheck hash, I didn't have to redo in Vista.

Another note: since resume.dat is a Binary file rather than a XML Serializer file, we have another limitation. The number of charactors you replace should be same as before, for example, G:\Standalone\µTorrent to H:\Standalone\µTorrent. You cannot do G:\Standalone to H:\Users\McoreD\My Documents\Applications\µTorrent. It is the same limiatation with Azureus. The only plaintext friendly settings file I have seen is the xml from BitComet.

Link to comment
Share on other sites

utorrent is quite portable but not perfect.

- start with moving settings to utorrent.exe dir

- just DON'T use "store .torrent files in:" option, and let the ut store .torrent where the main executable is (this makes quite a mess) :/

- you can put relative paths in "put new downloads in:" and "move completed downloads to:"

so far works great.

(and of course if you chose manually download location it won't be relative path)

EDIT: THIS WON'T WORK... ut has become unportable after few days putting absolute paths in resume.dat, and lost few relative download locations :(

Link to comment
Share on other sites

- start with moving settings to utorrent.exe dir

that's quite obvious and it's already in the FAQ

- just DON'T use "store .torrent files in:" option, and let the ut store .torrent where the main executable is (this makes quite a mess)

it's a BIG mess, not worth IMO

- you can put relative paths in "put new downloads in:" and "move completed downloads to:"

take a look at the thread on my first post

Link to comment
Share on other sites

It's worth if you want to have ut portable. It works if you change drive letters.

No you probably won't archive the dir. structure like you showed in the first post. Al least not for stored .torrent files, but complete/incomplete files should go where you want them.

I tried to put relative paths for "store .torrent files in:" and it worked for some time. But then it started to f*** up after win reinstall.

ok, I only tried with putting files inside ut folder (.\incoming and .\download) and not outside, but I think it should work.

Link to comment
Share on other sites

It's as McoreD said, resume.dat saves the drive's letter, for that reason alone you can't change the drive's letter without problems.

ok, I only tried with putting files inside ut folder (.\incoming and .\download) and not outside, but I think it should work.

Did you try to change the drive's letter with this configuration?

Link to comment
Share on other sites

Yeah, it was working fine and ut was saving absolute paths to resume.dat

I'm 100% sure because i moved it between drives a few times (for testing) and it worked!

...until today. I see ut has suddenly put absolute paths in resume.dat (fot .torrent files at least) and I stuck up at with ut at my current location. Really strange... looks like it's not portable at the end.


So this topic IS just a Feature Request after all :)

PS... I think I will try 1 more time later, but will put ".\" fot store .torrent location. Still torrent files will be where main executable is unfortunately.

Link to comment
Share on other sites


It doesn't work.

Relative paths looks OK for incoming and downloaded files.

For .torrent files path... ut will add absolute path to resume.dat, usually after second or third run (it should work if he wouldn't and if you chose ut dir for storring .torrent files)

Ut currently is not portable, but i think with a bit of fixing it can done (I'll be looking for it).

As for those who really want ut portable... maybe some workaround, like using win subst command for example (I don't know if subst req. admin login?)

Link to comment
Share on other sites

  • 2 weeks later...

For the vista and xp which vista partition original is G: in xp and change to C: when you boot to vista,i have a workaround

Lets start:

Vista has a new command call mklink, try run "mklink /?" without quote in cmd.exe for more explaination. mklink will help u to create a symbol link, which looks like a shortcut, but it acts as a virutal folder, instead of a redirect shortcut in xp

In my case, "C:\Documents and Settings\<yourusername>\Application Data\uTorrent" store all the settings including resume.dat and torrents in this folder.

In vista, the path will be "C:\Users\<yourusername>\AppData\Roaming\uTorrent"

Then i create a symbol link in vista:

mklink /d "C:\Users\<yourusername>\AppData\Roaming\uTorrent" "C:\Documents and Settings\<yourusername>\Application Data\uTorrent"

notice:first /d tells mklink to create symbol link folder instead of file which is default action, second is ...Roaming\uTorrent folder must not exist before creating a symbol folder

and don't worry about the torrents location because microsoft has made hidden symbol link between "Users\" and "Document and Settings", also "AppData\Roaming\uTorrent" and "Application Data\", not sure about it because when I install build 5728 my vista partition did not change to C: instead of staying as G: , so I set my torrent location to "C:\Documents and Settings\<yourusername>\Application Data\uTorrent", so that i can resume the downloads :D

Done! If you want to set the relative download location, easy by using symbol link

In my case - mklink /d "G:\downloads" "C:\downloads"

If you understand the mklink you can make use of it and apply to other software, such as my firefox profiles, foobar playlist

Hope can help you guys which running vista and xp

p.s: is it appropriate to reply in this post?

Link to comment
Share on other sites

It's fine, I guess, but it doesn't really help enough people, considering how most users are still running XP, and not Vista. In any case, the reason entire path changes don't work is because the number directly before the path indicates the length of the pathname. Meaning if you change the length, you have to change the number as well.

Link to comment
Share on other sites

  • 1 month later...

yuripave, great post, thanks. :)


It still doesn't quite help µTorrent being completely portable until resume.dat uses relative paths, just like Ultima pointed out.

A plain simple C file can be written with support for relative paths:

FILE *fp;

fp = fopen("test.txt", "r");

So I am not sure the necessary of µTorrent having to use absolute paths. I really hope ludde will take this into consideration and modify µTorrent accordingly.

Link to comment
Share on other sites

  • 3 months later...

I think this is a GREAT request!

I hope that ALL the preferences (including the torrent locations) are set up for relative paths. I set up my USB with following structure:

-drive's root









If the paths are relative, I can swap my usb to any computer, launch uTorrent with a shortcut in the root, and all the files would resume automatically.

The test for me is if I can give the drive to a friend who doesn't know a lot about this stuff, and just have them click the short-cut icon to launch the program on their home system...

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

I second this request!

Primarily I'd like to be able to store the torrent files in a "torrents" sub-folder in the settings folder. Right now if I just enter torrents & nothing else in the Store .torrent files field it creates a "torrents" sub-folder in whichever place the settings files are(either in %appdata%/etc or same folder as utorrent.exe) and it works at first but randomly(it seams) it starts storing the torrent files in a "torrents" sub-folder in that torrents download location and you get "error: Can't open torrent file" because it can't find the .torrent file after a restart

Link to comment
Share on other sites

Or maybe you could just have feature that, when the torrent gets "red", tries to find matching paths on other available drives.

X:\path\to\mypath\my files\my data (Torrent gets red)

µtorrents searches in on

Y:\path\to\mypath\my files\my data --> No match

Z:\path\to\mypath\my files\my data --> Match (Torrent gets green happy face)

Also if the torrent get moved within the same drive utorrent could do a search in the neighbour dirs (..\.. etc).

Utorrent would be smart never search whole drives, just look through the most obvious locations.

Of course this would be optional.

Link to comment
Share on other sites

  • 4 weeks later...

As far as I can see it is working now.

I've been testing a bit and it seems to work here (relative to utorrent.exe) can anyone confirm because I've been telling people it works. And maybe we could expand the 'USB Key' bit to the FAQ if it does work now.

If you don't set a "Store .torrents in:" folder (or any other folder for that matter) and just set the "Put new downloads in:" folder as ".\downloads" it seems to work. Off course all %appdata%\utorrent files should be moved next to the utorrent.exe

All torrents should of course be reloaded and should NOT be saved to a custom location (move the data of current torrents to the downloads subfolder in the utorrent.exe folder first so that it is automatically found when the torrent is readded). Preferably disable the "Always show dialog on manual add".

In fact I'd start with a clean slate (place utorrent.exe on the usb key / portable HD and create a empty settings.dat next to it) to be sure current settings and torrents aren't the problem.

The torrent path is indeed saved absolute but it seems utorrent has no problem locating the .torrent file if it is in the same folder as utorrent.exe and it updates the resume.dat with the new path (after closing µtorrent).

The download path is saved relative (if added relative).

My resume.dat after adding a torrent using a relative path (entering newline's after each : to make the info readable):

\Program Files\uTorrent\OOo_2.1.0_Win32Intel_install_ga.exe.torrentd8:
¶ e9:
hÐ'è8ÿÿÿÿÿÿÿïÿPä†SÀŸ 'B Ð!Ú7cÛ-,ÌDSyQÀ„eÒè4:
Ç Zp9¶0pFá%‹ÎÁá£Y‚6ïÜ£Y‚4:

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...