Shortcuts in \trains
#1
Posted 15 September 2015 - 05:40 PM
Which leads to my questions: Why can't OR follow the instructions in the shortcut?
As for why, I've been trying to solve the many to many relationship that exists between n minroutes and n cars -- the problem of having to copy the same car files to each miniroute. It's not a copy or size problem so much as what happens when you edit the car files? THEN all those copies turn out to be a real PITA.
With shortcuts it could be something like this:
The directory tree on the left could take any form you want while over on the right the same structure we're all using from MSTS. ALL of the directories on the right are shortcuts that point to the left. This way there is only one instance of each set of car files. You make one update and that is it... not copying anywhere.
#2
Posted 16 September 2015 - 01:04 AM
#3
Posted 16 September 2015 - 01:20 AM
Genma Saotome, on 15 September 2015 - 05:40 PM, said:
OR can't because old Windows 'shortcut' is file.lnk not link to another directory.
In windows ntfs filesystems you can make real 'shortcut' like in unix systems. It's called 'symbolic link' and if you make it that way everything will be working as you want.
Here is example how to do it: http://www.howtogeek...ndows-or-linux/
Quote
It's funny that better way of making 'shortcuts' exist in windows for 16 years but they still use old, useless '.lnk' way as default.
#4
Posted 16 September 2015 - 09:20 AM
Genma Saotome, on 15 September 2015 - 05:40 PM, said:
Which leads to my questions: Why can't OR follow the instructions in the shortcut?
I'm assuming you're using Junction Points here, and not what Windows calls a shortcut (which is a .LNK file as Goku says).
The key thing to remember with setup like this is that Junction Points are invisible to the application, so all path operations are on whatever original path was used to access them. E.g. if you go up a level, you're going up a level in the original path. This means that when a wagon references "..\\Common.Snd\\whatever.sms" it will be looking for it in the mini route's Trains folder.
If you're aware of the above and have accounted for it, I see no reason for it not to work, so perhaps a concrete example and indication of the failure would be useful.
#5
Posted 16 September 2015 - 09:54 AM
Goku suggested symbolic links, which are, for one PC, equivalent enough to junctions that the basics of the concepts are identical and so as far as understanding goes, they're fine. What feels different is there are
- so many folders inside of \trains.
- so many of them are duplicated in n number of miniroutes.
- not created as easily as are shortcuts, which are familiar to everyone.
IOW, my reservation over so many links is primarily administrative in nature -- a bit harder to set up -- and only then technical: is it really ok to have a thousand or so symbolic links? How do you backup the link itself?
#6
Posted 16 September 2015 - 10:28 AM
That said, I'm not sure of any particularly good way to back them up - most backup tools will or can ignore Junction Points/Symbolic Links to avoid duplicating files, but keeping the link itself seems uncommon. I've previously done something like this, as a painful-to-restore backup:
dir /s | findstr "Directory <JUNCTION <SYMLINK"
You may also be able to use the SysInternals Junction tool at least for Junction Points.
#7
Posted 16 September 2015 - 11:07 AM
the mini install is H:/Microsoft Train Simulator Sandpatch
and the new wagon folder was at h:/Trainset_Master/Boxcars/50ft_Boxcars_Mixed_SLI
the consist file line looked like this
WagonData ( RBOX_32226_LD ..\\..\\..\\Trainset_Master/Boxcars/50ft_Boxcars_Mixed_SLI )
Tested it in OR and it worked the consist showed up with the boxcar and i know it was the boxcar from the remote master folder as that folder did not exist in the Sandpatch mini install
i also fired up MSTS with BIN but in that, as suspected it came up as an error as MSTS loaded, that the wagon could not be found
so although it will take some time and i only need to do it to folders of equipment that would be appropriate to more than one mini, stuff like Trailer Train equip as one example if i start setting up new stuff from here on in and older stuff as and when it is used, eventually it will make things a bit tidier on the hard drive and give some space back.
#8
Posted 16 September 2015 - 12:30 PM
As pointed out, symlinks are a viable alternative.
Also, why don´t you just place a junction in the mini-routes? "Shortcut A" in your above draft would then read "Junction A"; same for B, C, etc.
Cheers, Markus
This post has been edited by markus_GE: 16 September 2015 - 12:39 PM
Reason for edit:: Forgot to reload the page after having had it open for hours - all point below already mentioned
#9
Posted 16 September 2015 - 12:43 PM
WRT backing up junctions, links, etc. - what does e.g. robocopy do with those?
Cheers, Markus
#10
Posted 16 September 2015 - 12:56 PM
burgerbern, on 16 September 2015 - 11:07 AM, said:
...and the new wagon folder was at h:/Trainset_Master/Boxcars/50ft_Boxcars_Mixed_SLI
...the consist file line looked like this
WagonData ( RBOX_32226_LD ..\\..\\..\\Trainset_Master/Boxcars/50ft_Boxcars_Mixed_SLI )
Well if something were to be done in the .com file I would prefer something that allows you to specify the path with a token, something like this:
$PATH A = h:\Trainset_Master\Boxcars\
$PATH B = H:\Trainset_Master\Reefers\
followed by
WagonData ( RBOX_32226_LD $A\50ft_Boxcars_Mixed_SLI )
WagonData ( SFRD_54321_LD $B\RS_SFRD_Rr40 )
There might be a few path statements in each .con file that way but IMO it'll still be easier to understand and do than repeat as needed until its undecipherable "..\\". It would also be vastly easier to relocate or restructure the master library with any editor that could do file search and replace (e.g., replace "Path A = h:\Trainset_Master" with "Path A = D:\My_Roster" in files *.con in fileset "E:\Open_Rails_Mini_1\trains\consist"). That certainly addresses all concerns about backups and IMO does a better job that relative paths because it allows the end user to have his own solution as to where his master library is located as well as how it is structured. IOW the benefit of a symbolic link w/o its issues. What is lost relative to the symbolic link is being able to edit something in the miniroute and have it propagate back into the library and on to all other places. But hten, if implemented, \trainset in the minirotues would be empty anyways.