Questions tagged [symlink]

Symlink is short for symbolic link (also soft link). It is a term for any file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution.

symlink is short for symbolic link (also soft link). It is a term for any file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution

2458 questions
14
votes
1 answer

Rollback compatibility version of libraries on Mac OS X

So, I love my Macbook, and she loves me. We have our ups and downs, but for the most part our relationship has been strong. Recently though we had a fight. it started out simply enough. I was asking her to do more, trying to be more…
Sevenless
  • 2,805
  • 4
  • 28
  • 47
14
votes
2 answers

.htaccess config with symbolic links and index files not working as expected

Like a lot of web developers, I like to use .htaccess to direct all traffic to a domain through a single point of entry when the request isn't for a file that exists in the publicly served directory. So something like this: RewriteEngine On # enable…
poolnoodl
  • 413
  • 1
  • 4
  • 10
14
votes
6 answers

Python can't open symlinked file

Python is unable to open my simlinked file. I made sure the file exists and I can access it. I was under the impression that symlinks are resolved on the OS level so Python would never know about…
Tom
  • 1,241
  • 2
  • 13
  • 21
14
votes
5 answers

Add symlink file as file using Git on Windows

I have a big (more than 1000 files) VS C# project in git. I need to create a small demo project and use ten files from the big project. To create this new project, I added ten files with mklink (symlink) from the big project to the small. All…
user3540246
14
votes
1 answer

Symlink giving "Permission denied"... to root

I wrote a simple script to automate creating a symbolic link. #!/pseudo today = "/tmp/" + date("Y-m-d") exec("ln -sf " + today + " /tmp/today") Simple enough; get today's date and make a symlink. Ideally run after midnight with -f so it just…
Xkeeper
  • 995
  • 3
  • 11
  • 22
14
votes
2 answers

How do I programmatically access the target path of a windows symbolic link?

Windows 6 (Vista and Server 2008) support proper symbolic links, which can be created via the CreateSymbolicLink function. But there doesn't appear to be a corresponding function for interrogating a symbolic link to obtain the path of the link's…
David Arno
  • 42,717
  • 16
  • 86
  • 131
14
votes
3 answers

Launching a python script via a symbolic link

I have an executable python script that exists in a "scripts" directory, and there's a symbolic link to that script (used to launch the file) in a root directory. Something like: . ├── scripts │ ├── const.py │ ├── fops.py │ ├── i_build.py │ …
Mike
  • 47,263
  • 29
  • 113
  • 177
14
votes
8 answers

batch file (windows cmd.exe) test if a directory is a link (symlink)

I learned just now that this is a way to test in a batch file if a file is a link: dir %filename% | find "" && ( do stuff ) How can I do a similar trick for testing if a directory is a symlink. It doesn't work to just replace…
GreenAsJade
  • 14,459
  • 11
  • 63
  • 98
14
votes
1 answer

Symbolic link to a non existing file

I tried to create a symbolic link to a non existing file ln -s non_existing_file.txt $HOME/dir1/dir2/my_symbolic_link Then I tried to write something in the non existing file using the symbolic link vi $HOME/dir1/dir2/my_symbolic_link Now after…
buvi
  • 141
  • 1
  • 1
  • 5
14
votes
5 answers

In homebrew how do I change the python3 symlink to only "python"

I want to install python using homebrew and I noticed there are 2 different formulas for it, one for python 2.x and another for 3.x. The first symlinks "python" and the other uses "python3". so I ran brew install python3. I really only care about…
BioXD
  • 357
  • 1
  • 2
  • 7
13
votes
1 answer

Ignoring symlinks in git

Is there a way to make git completely ignore symlinks (leave them in the tree, but not create them on checkout)? Alternatively, is there a way to make git convert between symlinks on linux and shortcuts on windows? Context: I'm using git with some…
Jason Gross
  • 5,928
  • 1
  • 26
  • 53
13
votes
2 answers

What is equivalent of mklink in Windows Powershell?

When I shift-right-click on a folder I had been able to "open command window here". NOTE: I am NOT INTERESTED in the registry hack to put this feature back on. After which I could use mklink to create symbolic links. Under recent profound wisdom of…
Blessed Geek
  • 21,058
  • 23
  • 106
  • 176
13
votes
3 answers

realpath() without resolving symlinks?

I already read about realpath(), but is there a function that I can pass a base directory and a filename that would give me the following result without resolving symlinks or checking whether files actually exist? Or do I have to use a modified…
thejh
  • 44,854
  • 16
  • 96
  • 107
13
votes
4 answers

docker cp a folder with a relative symlink: invalid symlink

In my container, I have a folder that contains a relative symlink to a parent's parent subfolder: $ docker run --name symlink-test ubuntu bash -c "mkdir -p /1/2; touch /1/2/a; ln -s ../../usr /1/2; touch /1/2/z; ls -l /1/2" …
morxa
  • 3,221
  • 3
  • 27
  • 43
13
votes
5 answers

How to create a symbolic link with SCons?

I'm using SCons for building a project and need to add a symbolic link to a file it is installing via env.Install. What command(s) will make a link that's the equivalent of running ln -s on the command line?
jblocksom
  • 14,127
  • 5
  • 34
  • 30