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: -----

#11 User is offline   James Ross 

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

Posted 16 September 2015 - 12:57 PM

View Postmarkus_GE, on 16 September 2015 - 12:43 PM, said:

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

RoboCopy defaults to "following" junctions and symlinks, which means you get the target file's contents at the source location (i.e. a duplicate). It does have options though:

  • /XJ :: eXclude Junction points. (normally included by default).
  • /XJD :: eXclude Junction points for Directories.
  • /XJF :: eXclude Junction points for Files.
  • /SL :: copy symbolic links versus the target.

The first three simply exclude them, so you'll just not have the directory/file which is junctioned/symlinked to somewhere else, while the third will actually copy the symlink (presumably only if the target location supports them, i.e. probably not on to most USB sticks).

Hard Links are (yet) another thing, and will pretty much always copy as normal files (RoboCopy has no options for them, and it doesn't really make sense to have options for them).

#12 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 - 01:18 PM

:sign_thanks: for the info, James :)

So, let´s make this more complicated - said shell-integrated file linking helper program "Link Shell Extension" (easily found on Google) includes an extension to Windows File Explorer´s copy program, called "Smart Copy". It enables the explorer to preserve links when copying. Can something like that be achieved with robocopy as well?

Cheers, Markus

#13 User is offline   James Ross 

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

Posted 16 September 2015 - 01:26 PM

View Postmarkus_GE, on 16 September 2015 - 01:18 PM, said:

So, let´s make this more complicated - said shell-integrated file linking helper program "Link Shell Extension" (easily found on Google) includes an extension to Windows File Explorer´s copy program, called "Smart Copy". It enables the explorer to preserve links when copying. Can something like that be achieved with robocopy as well?

Looks like you can do it with the same site's "ln" tool (--copy). As for RoboCopy, I've not tested it (so YMMV) but AFAICT symlinks are relative by default, so if you have "inner symlinks" I think they'll copy fine with the "/SL" option. "Outer symlinks" will probably copy as well but then be pointing to the wrong location (because they're relative) so you'll need to fix them. Junction Points are (IIRC) absolute by default so the opposite applies. Hard links are unlikely to be copied at all.

#14 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 17 September 2015 - 08:56 AM

:wallbash: I´ve used ln.exe multiple times already to achieve exactly that.

:sign_thanks: for straightening my chain of thought there, James :)

Cheers, Markus

#15 User is offline   Genma Saotome 

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

Posted 17 September 2015 - 11:04 AM

A bit more info... if you change your Windows explorer display to show the value of "Attributes" for your directory listing it will display the letters:

RD -- for any directory being used as a physical source directory, meaning these are real files in their real location.
DL -- for any directory being used as a linked directory, meaning this is a logical link that points back to a physical source directory.

If you also add "Link Target" it will give you the path and directory name of the physical source directory for any "DL" directory.
Attached Image: DL.jpg

Any adds, file edits, deletions in either the source or linked directory will be reflected immediately in the other -- they are all the same thing.

Also, it seems if you drop a symbol link into a directory that already has the same name the new link will be named "abc - symbolic link" (where abc is the duplicated name). This makes it easy to find and correct -- just delete the original directory and rename the link by removing " - symbolic link".

#16 User is offline   Genma Saotome 

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

Posted 15 October 2015 - 10:37 PM

I've returned to this topic and have been creating symbolic links using something called Link Shell Extension which makes it easy to create links in Windows Explorer.

It looks like OR is having a problem with certain types of links -- Junctions work but it's looking like Symbolic Links do not, at least at the directory level.

Example:

SourceLibrary\Trainset\Wagonfolder1 has real files.
Miniroute\Trainset\Wagonfolder1 is created using a symbolic link.

A loose consist definition that specifies Wagonfolder1 within the miniroute tree fails to find the .wag file. OR throws a ignoring missing wagon error message. However, using windows explorer I can see the .wag file in the miniroute tree, open it with my editor, make changes, and see the changes over in the SourceLibrary tree. So I know at some level the symbolic link works.

Can someone verify my conclusion -- that symbolic links don't work in OR -- please?

#17 User is offline   engmod 

  • Open Rails Developer
  • PipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 1,754
  • Joined: 26-February 08
  • Gender:Male
  • Location:Eltham, Victoria, Australia
  • Simulator:ORNYMG
  • Country:

Posted 15 October 2015 - 10:49 PM

Dave, What OS?

More info:-

https://msdn.microso...v=vs.85%29.aspx

#18 User is offline   James Ross 

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

Posted 16 October 2015 - 12:33 AM

View PostGenma Saotome, on 15 October 2015 - 10:37 PM, said:

A loose consist definition that specifies Wagonfolder1 within the miniroute tree fails to find the .wag file. OR throws a ignoring missing wagon error message. However, using windows explorer I can see the .wag file in the miniroute tree, open it with my editor, make changes, and see the changes over in the SourceLibrary tree. So I know at some level the symbolic link works.

Can someone verify my conclusion -- that symbolic links don't work in OR -- please?

I don't believe there's any reason symlinks wouldn't work; they're generally invisible to applications the same way junctions are.

Does the OR wagon warning include the path? Is it correct and if you paste it in to a file open dialog (of e.g. Notepad) does it open the file or say it can't be found?

#19 User is offline   Genma Saotome 

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

Posted 16 October 2015 - 03:00 PM

Several errors given, all .wags mentioned have their folders created as a symbolic link:

Quote

Warning: When expecting a number, we found a ) marker. Using the default 1 in E:\Bin\Open Rails - US West 1930-1952\trains\trainset\GS_SP_92536\GS_SP_92536_Ld.wag:line 10

Warning: When expecting a number, we found a ) marker. Using the default 1 in E:\Bin\Open Rails - US West 1930-1952\trains\trainset\XM_PRR_X29\XM_PRR_569178_LD.wag:line 6

Warning: When expecting a number, we found a ) marker. Using the default 1 in E:\Bin\Open Rails - US West 1930-1952\trains\trainset\XM_GN_USRA_DS\XM_GN_23715_LD.wag:line 7

Warning: Found a suffix ')' which could not be parsed as a Distance unit in E:\Bin\Open Rails - US West 1930-1952\trains\trainset\XM_ATSF_142331\xm_atsf_142331_mt.wag:line 5

Warning: When expecting a number, we found a ) marker. Using the default 1 in E:\Bin\Open Rails - US West 1930-1952\trains\trainset\XM_GN_USRA_DS\XM_GN_23715_MT.wag:line 7

Warning: When expecting a number, we found a ) marker. Using the default 1 in E:\Bin\Open Rails - US West 1930-1952\trains\trainset\XM_PRR_X29\XM_PRR_569178_MT.wag:line 7

Warning: When expecting a number, we found a ) marker. Using the default 1 in E:\Bin\Open Rails - US West 1930-1952\trains\trainset\XM_RDG_5087\XM_RDG_5087_MT.wag:line 7

Warning: When expecting a number, we found a ) marker. Using the default 1 in E:\Bin\Open Rails - US West 1930-1952\trains\trainset\XM_PRR_X29\XM_PRR_571797_MT.wag:line 7

Warning: When expecting a number, we found a ) marker. Using the default 1 in E:\Bin\Open Rails - US West 1930-1952\trains\trainset\XM_GN_USRA_DS\xm_gn_25096_ld.wag:line 7

Warning: When expecting a number, we found a ) marker. Using the default 1 in E:\Bin\Open Rails - US West 1930-1952\trains\trainset\GS_SP_92536\GS_SP_92536_ld.wag:line 10

Warning: When expecting a number, we found a ) marker. Using the default 1 in E:\Bin\Open Rails - US West 1930-1952\trains\trainset\XM_PRR_X29\XM_PRR_569178_ld.wag:line 6

Warning: Ignored missing wagon E:\Bin\Open Rails - US West 1930-1952\trains\trainset\RS_SFRD_Rr_40\RS_SFRD_8225_clsd_mty.wag in activity definition Loose consist.

Warning: Ignored missing wagon E:\Bin\Open Rails - US West 1930-1952\trains\trainset\RS_SFRD_Rr_35\RS_SFRD_7145_clsd_mty.wag in activity definition Loose consist.

Warning: Ignored missing wagon E:\Bin\Open Rails - US West 1930-1952\trains\trainset\RS_SFRD_Rr_40\RS_SFRD_8220_clsd_mty.wag in activity definition Loose consist.



Taking one .wag as an example (bold, in color, above)... it's .wag:
SIMISA@@@@@@@@@@JINX0D0t______

Wagon ( xm_gn_23715_MT

	WagonShape ( GN_USRA_box_23715.s )

	Include ( "..\\Common_Model_stds\\USRA_DS_Boxcar_Tim_Muir_Model\\XM_USRA_DS_Mesh_Dimensions.inc" )
	Include ( "..\\Common_Fleet_stds\\Std_Type_Coupler_Generic_Draft_Gear.inc" )

	Adheasion ( 0.2 0.4 2 0 )

	Include ( "..\\Common_Model_stds\\USRA_DS_Boxcar_Tim_Muir_Model\\XM_USRA_DS_MTY_Weight.inc" )
	Include ( "..\\Common_Fleet_stds\\Single_Pipe_KC_Brakes.inc" )

	Sound ( "genfreightwag2.sms" )
	Name ( "XM 40' GN 23715 MTY" )
)


The error complains about line 7. That file is present and it contains this code:
	Comment ( XM_USRA_DS_Mesh_Dimensions.inc )

	Type ( Freight )
      FreightAnim ( USRA_50t_parts.s 1 1 )
	Size ( 3.1m 4.6m 13.275m )
	WheelRadius ( 36in/2 )
	NumWheels ( 8 )
	InertiaTensor ( Box ( 3.1m 4.6m 12.975m ) )




All of the .wags mentioned in the error report were functional before I created symbolic links to replace the actual folders.

Some images of the directory listing (click on image for clarity):
Attached Image: jr0.jpg
That shows the presence of the "common" include files as peer directories to all of the .wag and .eng folders. These are the target s for many include files specified in .wags


Attached Image: jr1.jpg
That shows the folders within the "Common_Model" folder.


Attached Image: jr2.jpg
That shows the folders from the missing in the loose consist errors.


Attached Image: jr3.jpg
And that shows the folder holding the .wag file I displayed above.


The editor I use, EmEditor Pro, does understand that symbolic links are present. When I have the .wag file that I example above open in my editor I can click on the filename listed in the include statement and if the path is correct it will open that file. That gives me a very handy way to make sure I have not entered a typo of some kind. Were I to make an edit and save I can go over to what I'm calling the source library and verify the edit has migrated from the virtual to the actual file.

An observation: Previously I used junctions to make copies of entire routes. No problems at all. This week I am trying Symbolic links instead of junctions. AFAICT the difference between them is I can delete the virtual side of the symbolic link w/o harming the real files whereas w/ junctions a delete on the virtual side will kill everything on both sides. If that is correct I think symbolic links would be safer for me to use and that's why I decided to try them.

Last, from the command window this string: dir e:\ /a:l /s >"%Userprofile%\Desktop\Junctions.txt" will produce a text file showing all symbolic links and junctions of the specified drive (in this example, E:). Once one goes beyond a certain number there is a need to regularly produce this information and make sure it is on a backup. I certainly would not want to do 200 links by hand a second time.

If you need to see any more examples, let me know and I'll post them ASAP.

Also, let me know if you conclude this needs a bug report and I'll create it.

#20 User is offline   Genma Saotome 

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

Posted 16 October 2015 - 03:18 PM

View Postengmod, on 15 October 2015 - 10:49 PM, said:

Dave, What OS?

More info:-

https://msdn.microso...v=vs.85%29.aspx


Win7.

This is the page I used as a guide, including downloading the plug in they mention.

  • 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