[go: up one dir, main page]

Skip to content

Correct a UNIX symlinks from the example dir to src dir

Correct direction of symlink in UNIX.

Two symlinks were described in two examples that were proximate in the document. The Windows 10 sense of the symlinks was used incorrectly in the UNIX direction.

Targets typically already exist as files, and symlinks are usually being created.

Inside the examples directory that was corrected

  • MyClass.java is the link and
  • the relative path ../../../src/main/java/org/example/MyClass.java is the target.

As described previously this should be ln -s target link Since this is the order in UNIX.

I think this difference should be described in the text somehow to ensure that readers know that there is a difference, and to not make the same error.


Argument for the direction listed.

I am using somewhat authoritative references to ensure the direction of the link is documented exactly.

(Editorial: I have always found that the difference in viewing a link in the ls command is NOT the same as the creation of the symbolic link in the ln command, is one of the causes of this confusion, since you see links all the time when listing files, thus reinforcing the wrong direction.)


Linux

https://man7.org/linux/man-pages/man1/ln.1.html

   ln - make links between files

   ln [OPTION]... [-T] TARGET LINK_NAME
   ln [OPTION]... TARGET
   ln [OPTION]... TARGET... DIRECTORY
   ln [OPTION]... -t DIRECTORY TARGET...

DESCRIPTION

   In the 1st form, create a link to TARGET with the name LINK_NAME.
   In the 2nd form, create a link to TARGET in the current
   directory.  In the 3rd and 4th forms, create links to each TARGET
   in DIRECTORY.  Create hard links by default, symbolic links with
   --symbolic.  By default, each destination (name of new link)
   should not already exist.  When creating hard links, each TARGET
   must exist.  Symbolic links can hold arbitrary text; if later
   resolved, a relative link is interpreted in relation to its
   parent directory.

Windows 10 and 11

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mklink

mklink [[/d] | [/h] | [/j]] <link> <target>

argument Description
<link> Specifies the name of the symbolic link being created.
<target> Specifies the path (relative or absolute) that the new symbolic link refers to.

Merge request reports

Loading