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
13
votes
1 answer

Resolving Directory Symlink in Java

Given a File or Path directory object, how do I check if it is a symlink and how do I resolve it to the actual directory? I've tried File.getCannonicalFile(), Files.isSymbolicLink(Path) and many other methods, but none of them seem to work. One…
mailmindlin
  • 616
  • 2
  • 7
  • 25
13
votes
4 answers

Remove git-annex repository from file tree

I tried installing git-annex yesterday to backup my files. I ran git annex add . in the root of my repository tree and then a git commit. So far everything is fine. What I didn't know git-annex was doing was turning my entire file tree into a…
sffc
  • 6,186
  • 3
  • 44
  • 68
13
votes
1 answer

How do i commit a windows symlink into Git

I have added a windows (window 7) symlink to my codebase ("foo" -> \\server\foo). I have a large set of configuration files under the networks share -\server\foo location. How do i check-in this symlink "foo" into my Git repo? Any other user cloning…
praskris
  • 479
  • 5
  • 15
13
votes
2 answers

Soft link in Mercurial

Is there some equivalent in Mercurial to NIX soft- or hard- links to directories or files. Basically that a file (or directory) is linked to a file "somewhere else" and follows the version of that location (Unlike a regular branch I think, where one…
Olav
  • 1,758
  • 4
  • 27
  • 49
12
votes
4 answers

Creating a relative symlink in python without using os.chdir()

Say I have a path to a file: /path/to/some/directory/file.ext In python, I'd like to create a symlink in the same directory as the file, that points to the file. I'd like to end up with this: /path/to/some/directory/symlink -> file.ext I can do…
Josh
  • 123
  • 1
  • 1
  • 4
12
votes
1 answer

php getcwd() resolving target of symlink instead of current directory

As far as I am aware, php's getcwd() (and similar functions eg dirname(__FILE__)) are supposed to return the current directory of the file being executed. If the current directory happens to be a symlink to another directory, php (presumably in…
myk00
  • 329
  • 1
  • 3
  • 10
12
votes
4 answers

Moving MySQL InnoDB database to separate drive

In my MySQL installation I have one InnoDB database that I know will grow very large so I have decided to move it to its own disk. I was hoping to do this by moving the files to the other disk and then create a symlink but I run into errors! This is…
Norling
  • 1,153
  • 2
  • 10
  • 24
12
votes
2 answers

Ignore symbolic links in .gitignore

Is it possible to tell Git to ignore symlinks ? I'm working with a mixed Linux / Windows environment and, as you know, symlinks are handled very differently between the two.
Andrei
  • 1,606
  • 4
  • 19
  • 31
12
votes
3 answers

Privlege error trying to create symlink using python on windows 10

I am attempting to create a symlink using python on windows 10 (home version) with the foll. code: import ctypes kdll = ctypes.windll.LoadLibrary("kernel32.dll") kdll.CreateSymbolicLinkW(src_dir, dst_dir, 1) but I get the foll. error: *** error:…
user308827
  • 21,227
  • 87
  • 254
  • 417
12
votes
2 answers

Is pushing a symbolic link to git a bad practice?

I'm unsure of whether or not pushing symbolic links to a git repo is a bad practice or not. Is there any risk or bad reason to do so? I haven't seen a good answer. If anyone has a good resource or explanation please share.
Alec Walczak
  • 427
  • 1
  • 5
  • 17
12
votes
1 answer

What is the difference between fs.link and fs.symlink? Are they platform independent?

What is the difference between fs.link and fs.symlink? I want to programmatically create a symbolic link to a physical file (or another symlink), and I'm on Linux, but wondered if it was possible to write a OS independant solution? What are the…
Yanick Rochon
  • 51,409
  • 25
  • 133
  • 214
12
votes
4 answers

listFiles() of File not working on symbolic links?

I have the following File object pointing to a directory via symbolic link, File directory = new File("/path/symlink/foo/bar"); String[] files = directory.listFiles(); listFiles() returns null, is this because of the symlink? if yes, how will I go…
setzamora
  • 3,560
  • 6
  • 34
  • 48
12
votes
5 answers

Java: check symbolic link file existence

We talk about java 1.6 here. Since symoblic link is not yet supported, how can examine the existence of them. 1: tell wheather the link file itself exists (return true even if the link is broken) 2: follow the link and tell wheather underlying file…
solotim
  • 1,826
  • 4
  • 24
  • 41
12
votes
2 answers

Create a custom symbolic link to a library at install time with CMake

Under Linux with CMake, I'm building a shared library libIex-2_0.so.10.0.1 ADD_LIBRARY (Iex SHARED [*.cpp] ) SET_TARGET_PROPERTIES(Iex PROPERTIES OUTPUT_NAME "Iex-2_0") The 10.0.1 version is set with a call to SET_TARGET_PROPERTIES ( Iex …
Charles
  • 733
  • 3
  • 7
  • 19
12
votes
2 answers

Capistrano Symlinks Being Cached?

I've been setting up PHP deployments with Capistrano on CentOS 6 and have run into an interesting issue. The way capistrano works, it sets up folders like this: /var/www/myapp.com/ current (symlink to latest release in…
Jeremy Harris
  • 24,318
  • 13
  • 79
  • 133