Elvas Tower: Shortcuts in \trains - Elvas Tower

Jump to content

  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

Shortcuts in \trains Rate Topic: -----

#1 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,350
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 15 September 2015 - 05:40 PM

I did a test the other day... put a shortcut into \trains at the directory level that pointed to another directory on another disk, the later holding all of the actual files you need to define a car. I then edited a consist file, referenced the .wag name and the shortcut name. I was hoping OR would simply follow the shortcut over to the other disk and pick up the necessary files. It did not (this may have been a user error but I'm pretty sure I did this correctly).

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:
Attached Image: Lib.jpg


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 User is offline   burgerbern 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 491
  • Joined: 26-May 06
  • Gender:Male
  • Location:UK
  • Simulator:ORTS
  • Country:

Posted 16 September 2015 - 01:04 AM

That would be very useful, i edited a folder of wagons the other day and then had to hunt through 45 mini routes to see if i had used the same in any of the others, turns out i had in 16 of them. its not a space issue i have 2.5TB to play with but as Dave said one of keeping multiple instances of cars and engines synchronised to the latest build or update.

#3 User is offline   Goku 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,785
  • Joined: 12-December 13
  • Gender:Male
  • Simulator:my own
  • Country:

Posted 16 September 2015 - 01:20 AM

View PostGenma Saotome, on 15 September 2015 - 05:40 PM, said:

Which leads to my questions: Why can't OR follow the instructions in the shortcut?

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

Want to easily access folders and files from different folders without maintaining duplicate copies? Here’s how you can use Symbolic Links to link anything in Windows 10, 8, 7, Vista, XP, and Ubuntu.


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 User is online   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,490
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 16 September 2015 - 09:20 AM

View PostGenma Saotome, on 15 September 2015 - 05:40 PM, said:

I did a test the other day... put a shortcut into \trains at the directory level that pointed to another directory on another disk, the later holding all of the actual files you need to define a car. I then edited a consist file, referenced the .wag name and the shortcut name. I was hoping OR would simply follow the shortcut over to the other disk and pick up the necessary files. It did not (this may have been a user error but I'm pretty sure I did this correctly).

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 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,350
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 16 September 2015 - 09:54 AM

I know and use Junctions (I populate multiple miniroutes with the same route, leaving \trains to be local and unique).


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 User is online   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,490
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 16 September 2015 - 10:28 AM

It's completely fine to have thousands of Junction Points and/or (file and directory) Symbolic Links - they're all stored in the same way, ultimately, as a special file/directory whose contents in the pointer to another location.

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 User is offline   burgerbern 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 491
  • Joined: 26-May 06
  • Gender:Male
  • Location:UK
  • Simulator:ORTS
  • Country:

Posted 16 September 2015 - 11:07 AM

OK i just tried a different approach, i did not try to reference a special folder on another drive letter as Dave is trying to do, but i did set up a directory structure outside of MSTS on the same drive letter as the 45 Mini Installs, i then referenced that set of folders in a consist file from a mini install that did not actually have a copy of the wagons in it (so that if it appeared i knew it was from the remote location) and after a couple of revisions it worked the drive H is 500GB in size and has a fraction over 250GB's worth of files on it, if all the multiple folders of equipment (IE those that exist in more than one miniroute ) could be referenced from one location A: space would be saved and B: when any updating was done it would be instantly available to all mini routes thar referenced it. I used my Sandpatch mini for the test which has 4 routes in it and the folder i had created where all the SLI 50ft std boxcar types are stored.

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 User is offline   markus_GE 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 4,862
  • Joined: 07-February 13
  • Gender:Male
  • Location:Leoben, Styria, Austria, Europe
  • Simulator:ORTS / MSTS
  • Country:

Posted 16 September 2015 - 12:30 PM

EDIT: All point below already mentioned

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 User is offline   markus_GE 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 4,862
  • Joined: 07-February 13
  • Gender:Male
  • Location:Leoben, Styria, Austria, Europe
  • Simulator:ORTS / MSTS
  • Country:

Posted 16 September 2015 - 12:43 PM

I am aliasing cabs and sounds from two Common.* directories by placing hardlinks in the relevant folders of a locomotive / car folder, and typing the filename in the ENG file. Moves those lengthy alias paths into the CVF / SMS (viewed less often) and makes it easier (a least for me) to do the aliasing - all I need to do is use Link Shell Extension (shell-integrated Link creation tool) to create the links :)

WRT backing up junctions, links, etc. - what does e.g. robocopy do with those?

Cheers, Markus

#10 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,350
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 16 September 2015 - 12:56 PM

View Postburgerbern, 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.

  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users