Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 02-28-2016, 12:46 PM   #1
Airal
Banned
 
Join Date: Nov 2015
Posts: 406
Default 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)
Airal is offline   Reply With Quote
Old 02-28-2016, 01:13 PM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,737
Default

There's a reason junctions aren't really used much on Windows
Justin is online now   Reply With Quote
Old 02-28-2016, 02:06 PM   #3
kenz
Human being with feelings
 
Join Date: Aug 2013
Posts: 339
Default

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.
kenz is offline   Reply With Quote
Old 02-28-2016, 02:45 PM   #4
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,737
Default

A better solution is probably to detect identical files...
Justin is online now   Reply With Quote
Old 02-28-2016, 03:45 PM   #5
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,773
Default

Quote:
Originally Posted by Airal View Post
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
mschnell is offline   Reply With Quote
Old 02-28-2016, 03:51 PM   #6
Airal
Banned
 
Join Date: Nov 2015
Posts: 406
Default

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?
Airal is offline   Reply With Quote
Old 02-28-2016, 04:30 PM   #7
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,737
Default

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.
Justin is online now   Reply With Quote
Old 02-28-2016, 04:43 PM   #8
Airal
Banned
 
Join Date: Nov 2015
Posts: 406
Default

Quote:
Originally Posted by Justin View Post
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.
Airal is offline   Reply With Quote
Old 02-28-2016, 05:00 PM   #9
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,737
Default

Hmm yeah maybe not too bad, lemme look more.
Justin is online now   Reply With Quote
Old 02-28-2016, 05:48 PM   #10
Airal
Banned
 
Join Date: Nov 2015
Posts: 406
Default

Quote:
Originally Posted by Justin View Post
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
Airal is offline   Reply With Quote
Old 02-28-2016, 05:52 PM   #11
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,737
Default

Quote:
Originally Posted by Airal View Post
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!
Justin is online now   Reply With Quote
Old 02-28-2016, 08:29 PM   #12
Airal
Banned
 
Join Date: Nov 2015
Posts: 406
Default

Quote:
Originally Posted by Justin View Post
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 )

Last edited by Airal; 02-28-2016 at 08:59 PM.
Airal is offline   Reply With Quote
Old 02-28-2016, 09:48 PM   #13
lachrimae
Human being with feelings
 
lachrimae's Avatar
 
Join Date: May 2010
Location: Austin, TX
Posts: 791
Default

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

lachrimae is offline   Reply With Quote
Old 02-28-2016, 11:17 PM   #14
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,773
Default

Quote:
Originally Posted by Airal View Post
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
mschnell is offline   Reply With Quote
Old 02-29-2016, 03:25 AM   #15
kenz
Human being with feelings
 
Join Date: Aug 2013
Posts: 339
Default

Quote:
Originally Posted by mschnell View Post
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...
kenz is offline   Reply With Quote
Old 02-29-2016, 09:23 AM   #16
Dstruct
Human being with feelings
 
Join Date: Jul 2006
Posts: 12,482
Default

FIXED (5.20pre14)
Dstruct is offline   Reply With Quote
Old 02-29-2016, 09:40 AM   #17
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,737
Default

Quote:
Originally Posted by kenz View Post
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?"
Justin is online now   Reply With Quote
Old 02-29-2016, 10:02 AM   #18
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,268
Default

Quote:
Originally Posted by Justin View Post
This is REAPER, so you'll get... both!
Thank you!

heda is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:40 AM.


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