symlink

Is there a way to check if there are symbolic links pointing to a directory?

跟風遠走 提交于 2019-11-28 15:34:23
I have a folder on my server to which I had a number of symbolic links pointing. I've since created a new folder and I want to change all those symbolic links to point to the new folder. I'd considered replacing the original folder with a symlink to the new folder, but it seems that if I continued with that practice it could get very messy very fast. What I've been doing is manually changing the symlinks to point to the new folder, but I may have missed a couple. Is there a way to check if there are any symlinks pointing to a particular folder? I'd use the find command. find . -lname

symbolic link: find all files that link to this file

半城伤御伤魂 提交于 2019-11-28 15:17:07
Hallo all, I need to do this in linux: Given: file name 'foo.txt' Find: all files that are symbolic links to 'foo.txt' How to do it? Thanks! DigitalRoss It depends, if you are trying to find links to a specific file that is called foo.txt, then this is the only good way: find -L / -samefile path/to/foo.txt On the other hand, if you are just trying to find links to any file that happens to be named foo.txt , then something like find / -lname foo.txt or find . -lname \*foo.txt # ignore leading pathname components Find the inode number of the file and then search for all files with the same inode

Can you change what a symlink points to after it is created?

烂漫一生 提交于 2019-11-28 15:17:02
Does any operating system provide a mechanism (system call — not command line program) to change the pathname referenced by a symbolic link (symlink) — other than by unlinking the old one and creating a new one? The POSIX standard does not. Solaris 10 does not. MacOS X 10.5 (Leopard) does not. (I'm tolerably certain neither AIX nor HP-UX does either. Judging from this list of Linux system calls , Linux does not have such a system call either.) Is there anything that does? (I'm expecting that the answer is "No".) Since proving a negative is hard, let's reorganize the question. If you know that

Create a symbolic link of directory in Ubuntu [closed]

主宰稳场 提交于 2019-11-28 15:01:37
Below is my code for creating a symlink of a directory: sudo ln -s /usr/local/nginx/conf/ /etc/nginx I already created the directory /etc/nginx . I just want the contents of the source directory ( /usr/local/nginx/conf/ ) to be in the contents of the target directory ( /etc/nginx ). But when I execute the code, /etc/nginx contains a directory called conf , instead of the contents of conf . That directory contains the contents I want, but in the wrong location. Why did it put a directory in the target folder, instead of just putting the contents of the directory in the target folder? FatalError

Creating hard and soft links using PowerShell

拥有回忆 提交于 2019-11-28 15:00:50
Can PowerShell 1.0 create hard and soft links analogous to the Unix variety? If this isn't built in, can someone point me to a site that has a ps1 script that mimics this? This is a necessary function of any good shell, IMHO. :) Jason R. Coombs You can call the mklink provided by cmd , from PowerShell to make symbolic links: cmd /c mklink c:\path\to\symlink c:\target\file You must pass /d to mklink if the target is a directory. cmd /c mklink /d c:\path\to\symlink c:\target\directory For hard links, I suggest something like Sysinternals Junction . jocassid Windows 10 (and Powershell 5.0 in

PHP symlink() fails on Windows 7

主宰稳场 提交于 2019-11-28 12:53:22
PHP symlink() function fails on Windows 7 with the error: Warning: symlink(): Cannot create symlink, error code(3) in C:\xampp\htdocs\…\lib\model\doctrine\Website.class.php It's a XAMPP server on with PHP 5.3.8. From the symlink() documentation: 5.3.0 This function is now available on Windows platforms (Vista, Server 2008 or greater). Any ideas/suggestions? Might be a bug in PHP 5.3 according to this: https://bugs.php.net/bug.php?id=48975 and this: http://forum.wampserver.com/read.php?2,64011 (reply #2) Maybe you could upgrade to PHP 5.4 and see if it works? I use this //symlink($target, $link

Symlink is not working in my local machine

 ̄綄美尐妖づ 提交于 2019-11-28 12:42:50
问题 I'm using Xampp setup in Windows 7 machine. I am trying to configure sub-folder module in Drupal 7. But it says "Cannot create symlink, error code(1314)" error which stops me in configuring the module properly. And subfolder module functionality is not working as expected. 回答1: This is a Windows error message indicating that the current user does not have permission to create symbolic links. By default, this privilege is granted to administrators only. Your options for fixing this are either

Having trouble implementing a readlink() function

眉间皱痕 提交于 2019-11-28 12:14:38
I've been trying to figure out a way to get some sort of ability to be able to return the true abspath of a symbolic link in Windows, under Python 2.7. (I cannot upgrade to 3.x, as most DCCs such as Maya/3ds max do not use that version of Python) I've looked at the sid0 ntfs utils (whose islink() function works, but readlink() function always returns an empty unicode string for me for some reason), and the juntalis ntfs libs (which unfortunately, I couldn't get to work), along with a helpful script someone posted: import os, ctypes, struct from ctypes import windll, wintypes FSCTL_GET_REPARSE

android: determining a symbolic link

和自甴很熟 提交于 2019-11-28 11:17:24
I am scanning all directories starting from "/" to find some particular directories like "MYFOLDER". However, the folder is that I get double instances of the same folder. This occurs because one folder is located in "/mnt/sdcard/MYFOLDER" and the same folder has a symbolic link in "/sdcard/MYFOLDER".. My Question is, "Is there any way to determine whether the folder is a symbolic link or not?". Please give me some suggestions.. This is essentially how they do in Apache Commons (subject to their license ): public static boolean isSymlink(File file) throws IOException { File canon; if (file

Soft link in Mercurial

末鹿安然 提交于 2019-11-28 11:03:43
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 would have to merge) Ry4an Brase Mercurial versions soft links that are internal to the repository just great. It'll detect them, record them, and create them for you. Is there a specific use case you're looking for? The closest thing to an link that reaches outside the repository is a subrepo, which is a pointer to a specific version of another