Link creates newname as a hard link to the oldname file. Both paths are relative to the root. See [Link] for more details.
If oldname is a symbolic link, Link creates new link to oldname and not its target. This behavior may differ from that of [Link] on some platforms.
When GOOS=js, Link returns an error if oldname is a symbolic link.
Symlink creates newname as a symbolic link to oldname. See [Symlink] for more details.
Symlink does not validate oldname, which may reference a location outside the root.
On Windows, a directory link is created if oldname references a directory within the root. Otherwise a file link is created.
Generated using TypeDoc
Root may be used to only access files within a single directory tree.
Methods on Root can only access files and directories beneath a root directory. If any component of a file name passed to a method of Root references a location outside the root, the method returns an error. File names may reference the directory itself (.).
Methods on Root will follow symbolic links, but symbolic links may not reference a location outside the root. Symbolic links must not be absolute.
Methods on Root do not prohibit traversal of filesystem boundaries, Linux bind mounts, /proc special files, or access to Unix device files.
Methods on Root are safe to be used from multiple goroutines simultaneously.
On most platforms, creating a Root opens a file descriptor or handle referencing the directory. If the directory is moved, methods on Root reference the original directory in its new location.
Root's behavior differs on some platforms: