Questions tagged [symlink-traversal]
46 questions
153
votes
14 answers
Docker follow symlink outside context
Yet another Docker symlink question. I have a bunch of files that I want to copy over to all my Docker builds. My dir structure is:
parent_dir
- common_files
- file.txt
- dir1
- Dockerfile
- symlink ->…

Ravi
- 3,719
- 6
- 28
- 40
39
votes
1 answer
Python os.walk + follow symlinks
How do I get this piece to follow symlinks in python 2.6?
def load_recursive(self, path):
for subdir, dirs, files in os.walk(path):
for file in files:
if file.endswith('.xml'):
file_path = os.path.join(subdir,…

fmalina
- 6,120
- 4
- 37
- 47
23
votes
2 answers
Node.js: Check if file is an symbolic link when iterating over directory with 'fs'
Supervisor is a package for Node.js that monitors files in your app directory for modifications and reloads the app when a modification occurs.
This script interprets symbolic links as regular files and logs out a warning. I would like to fork…

james_womack
- 10,028
- 6
- 55
- 74
11
votes
1 answer
in git bash in windows ln -s /destinations/path/ link_name just copies the destination rather than creates a link
In Git bash i have run the following:
ln -s "//server/path/Resource/" test
When I check if it's worked:
ls -l
It appears as a folder rather than a symlink.
I am using windows and trying to create a symbolic link to a network location.
This is…

TaxiMike
- 189
- 1
- 9
11
votes
1 answer
Follow symlinks in SVN
I have a linux directory (and don't need any windows checkout):
/home/me/projects/project1
In this project, I need SVN (1.8.8) to follow a symlink "link1":
/home/me/projects/project1/link1/
But SVN won't let me do that,…

Cyrille
- 13,905
- 2
- 22
- 41
8
votes
1 answer
Node.js determine path targeted by symlink
Note: using Node.js 8
I have a series of symlinks: a -> b -> c
I need to resolve the initial symlink a to its target destination b. How can this be accomplished in Node.js?
The fs.realpath function resolves chains of symlinks, so it resolves a to…

rich remer
- 3,407
- 2
- 34
- 47
7
votes
4 answers
How to list all members of a symlink-chain?
Finding the java binaries can be painful:
which java gives /usr/bin/java
lh $(which java) gives /usr/bin/java -> /etc/alternatives/java
lh /etc/alternatives/java gives /etc/alternatives/java -> /usr/lib/jvm/jdk1.8.0_66/bin/java
Is there a way to…

Edward
- 4,453
- 8
- 44
- 82
7
votes
1 answer
How to get diff to NOT follow symlinks?
I'm using diff to compare two huge volumes, and it is actually comparing many symlinked files over and over.
Is there some way to stop this? I want it to just compare the link itself; not follow it.
Or is there an alternate app that has this option?

Dan
- 1,257
- 2
- 15
- 31
6
votes
3 answers
How can I tell if a symbolic link exists at a certain path?
I have an original file, /path/to/foo.txt, and a symbolic link to it, /other/path/to/foo.txt. I delete /path/to/foo.txt, but leave the symbolic link in-place. How can I tell that the symbolic link still exists using Cocoa APIs?
I found this by…

Ky -
- 30,724
- 51
- 192
- 308
6
votes
1 answer
How to handle symlinks when reading data from a file path in swift
I have a file path as a string. I want to:
Test if there's a file there
Read the contents of the file as a string
the problem I'm having is that sometimes that file path involves a symbolic link (symlink). Maybe to the file itself. Maybe to one of…

masukomi
- 10,313
- 10
- 40
- 49
5
votes
2 answers
How do you determine the path of the file that a symlink points to?
In Linux, if you have a path to a file which you know is a symlink, how do you programmatically determine (in C or C++) the path to the file that it points to?

Jonathan M Davis
- 37,181
- 17
- 72
- 102
4
votes
1 answer
How to have Git 1.6 follow "beyond symlinks"
Apparently, the bug where git follows and track files beyond symlinks (git add symlink/) has been fixed around v1.6. Now this was a bug that works in my favor. Now that we've upgraded to v1.6.3.3, is there any way to reproduce that behavior without…

keikun17
- 121
- 6
3
votes
1 answer
Which methods of java.nio.file.Files follow symbolic links and which don't?
The Java helper class java.nio.file.Files has methods to access file attributes. Some of the class methods follow symbolic links (all methods with a LinkOption parameter), while for some other methods it is not clear wether symbolic links are…

Julien Kronegg
- 4,968
- 1
- 47
- 60
3
votes
1 answer
Firebase "symlink" to another node
In relation to my other question about modelling a real user-facing tree structure (Using firebase tree structure to represent a "document outline" structure directly), I was thinking of putting in place a generic approach to "symlinking", at…

KarolDepka
- 8,318
- 10
- 45
- 58
2
votes
1 answer
OSX Apache web pages on external drive don't work
I have a symlink /Library/WebServer/Documents/2Tlnk to /Volumes/2TMacBook/lnk1 which is a directory with an index.html file in it. 2TMacBook is an external drive, not a separate MacBook computer. I get a 403 (You don't have permission to access…

Garr Lystad
- 41
- 1
- 5