Cockos Incorporated Forums

Cockos Incorporated Forums (https://forum.cockos.com/index.php)
-   REAPER Bug Reports (https://forum.cockos.com/forumdisplay.php?f=22)
-   -   Reaper doesn't understand junctions (FIXED) (https://forum.cockos.com/showthread.php?t=173508)

Airal 02-28-2016 12:46 PM

Reaper doesn't understand junctions (FIXED)
 
I use a junction to deal with project complications. Reaper doesn't understand that two paths that point to the same place are identical. Instead, it saves duplicate files to the exact same location with a file increment.

e.g.,

C:\Projects\MyProject
A:\MyProject (A junction pointing to C:\Projects\MyProject)

When loading a project from the first path then saving it to the second path, reaper duplicates(with file increment) all the files.

Suggestions:

1. Resolve the junction to see if it is the same path as the save path

2. Check if the files being duplicated already exist and ask to use them(could do a binary compare or something).

(I noticed this because of a crash and I loaded the project from the non-junction path, when I saved the project, reaper "converted"/"saved" all the items to the "new" path)

Justin 02-28-2016 01:13 PM

There's a reason junctions aren't really used much on Windows :)

kenz 02-28-2016 02:06 PM

I actually like that most applications don't care about links/junctions. I love to use symbolic links/junctions for custom organization, especially when apps have no clue about them so their usage can be very predictable.

They can be used for "compatibility" too. If the app is unaware, you can just use an abstract path say, C:\Projects, and then it can reside anywhere literally. Reaper will know it's in C:\Projects because that's where you open it from; and it will still work even if you change paths later. Just be sure to open them from C:\Projects and not the actual path.

I use symbolic links / junctions extensively.

Justin 02-28-2016 02:45 PM

A better solution is probably to detect identical files...

mschnell 02-28-2016 03:45 PM

Quote:

Originally Posted by Airal (Post 1645224)
Suggestions:

1. ...

2. ...

3. (What I do) Hold the files on a Linux Server (i.e. a NAS), Here you can do hard and soft links as appropriate.

-Michael

Airal 02-28-2016 03:51 PM

It should be quite easy to get the junction target and compare it to the saved path target. If they are the same, then just use one or the other(shouldn't matter with relative paths I imagine). Might have to recurse for junctions of junctions.

One could do a binary check of the files, in fact, it might be a good idea to "reuse" files but I think it would require a full binary compare for safety but could be slow in some cases.

I'm like Ken, I use junctions all the time for similar reasons. I don't see why getting the *real* path that the project was opened in and the *real* path that it is being saved in, and if they are the same, do not create extra files. Seems like something rather trivial?

Justin 02-28-2016 04:30 PM

I think doing what you describe is actually quite complex -- a binary compare of the files is preferable IMO, since a) obviously different files will be determined quickly, and b) exactly the same files will still avoid a copy.

Airal 02-28-2016 04:43 PM

Quote:

Originally Posted by Justin (Post 1645324)
I think doing what you describe is actually quite complex -- a binary compare of the files is preferable IMO, since a) obviously different files will be determined quickly, and b) exactly the same files will still avoid a copy.

Surely not?

https://msdn.microsoft.com/en-us/lib...8VS.85%29.aspx

A final path is the path that is returned when a path is fully resolved. For example, for a symbolic link named "C:\tmp\mydir" that points to "D:\yourdir", the final path would be "D:\yourdir".

Just use that to translate the saved dir path when checking. Should be a few lines of code? At the very least, it could be used as an first choice check before binary compare. Of course, I'm assuming implementation is rather straightforward.

Justin 02-28-2016 05:00 PM

Hmm yeah maybe not too bad, lemme look more.

Airal 02-28-2016 05:48 PM

Quote:

Originally Posted by Justin (Post 1645337)
Hmm yeah maybe not too bad, lemme look more.

Thanks. I think it should be relatively easy and there are several ways(win32, junction.exe, etc...). It's not a priority though and it's probably a rather rare issue. I'd settle for the binary comparison as a solution too ;)

Justin 02-28-2016 05:52 PM

Quote:

Originally Posted by Airal (Post 1645344)
Thanks. I think it should be relatively easy and there are several ways(win32, junction.exe, etc...). It's not a priority though and it's probably a rather rare issue. I'd settle for the binary comparison as a solution too ;)

This is REAPER, so you'll get... both!

Airal 02-28-2016 08:29 PM

Quote:

Originally Posted by Justin (Post 1645350)
This is REAPER, so you'll get... both!

but what if I don't want both?!?! ;)

Thanks man! Your awesome! I wish businesses(governments, people in general, etc) were run by people more like you! The world would be a better place! (I'm not sucking up, just stating the facts ;))

lachrimae 02-28-2016 09:48 PM

Next time I see a troll I'm pointing them to this thread...

http://cs317516.vk.me/u182948476/a_17712005.jpg

mschnell 02-28-2016 11:17 PM

Quote:

Originally Posted by Airal (Post 1645315)
It should be quite easy to get the junction target and compare it to the saved path target.

An application never should "implicitly" look at such hidden properties of any files. This is reserved for OS-internals and OS-tools.

-Michael

kenz 02-29-2016 03:25 AM

Quote:

Originally Posted by mschnell (Post 1645414)
An application never should "implicitly" look at such hidden properties of any files. This is reserved for OS-internals and OS-tools.

-Michael

I agree, it should not be on by default definitely...

Dstruct 02-29-2016 09:23 AM

FIXED (5.20pre14)

Justin 02-29-2016 09:40 AM

Quote:

Originally Posted by kenz (Post 1645460)
I agree, it should not be on by default definitely...

Why not? it's only used for the limited case of "is this file effectively already there?"

heda 02-29-2016 10:02 AM

Quote:

Originally Posted by Justin (Post 1645350)
This is REAPER, so you'll get... both!

Thank you!

https://stash.reaper.fm/26870/THISISREAPER.jpg


All times are GMT -7. The time now is 06:11 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.