symlink

repair broken symlinks / reinstall php5

廉价感情. 提交于 2019-12-06 01:28:16
问题 How the I repair broken symlinks? / Delete 'dead' files? Context: Since I messed up my php.ini configuration on one of my local testservers, I decided to re-installed the basic webserver stuff. (apache2, php5,..) Problem: After installation is /etc/apache2/php5/php.ini missing at all, /etc/apache2/php5/conf.d is a 'broken symlink', I think. Error: During installation: Not replacing deleted config file /etc/php5/apache2/php.ini So what's these 'broken symlinks'? I can find them using 'ls /dir'

Safe way to remove a symbolic link to an non-existing directory (for the python binary)

浪子不回头ぞ 提交于 2019-12-05 21:30:06
I accidentally typed: sudo ln -sf /usr/local/bin/python2.5/ /usr/bin/python instead of: sudo ln -sf /usr/local/bin/python2.5 /usr/bin/python Now bash tells me that /usr/bin/python is not a directory whenever I run python. ls -l /usr/bin/python gives me expectedly /usr/bin/python --> /usr/local/bin/python2.5/ Is there any safe way to remove that symbolic link to a directory (that does not exist) and replace it with a link to the intended file? Arigato in advance if you have any ideas. I am stuck.... you can simply remove the link with rm : rm /usr/bin/python You remove a symlink the same way

How can I resolve a symbolic link in Perl?

别来无恙 提交于 2019-12-05 20:32:16
I have a symbolic name java or jre or jre1.5 or jre1.6 or java1.5 or java1.6 that will point to the respective directory. Taking into account the first instance, it will look like: java -> /usr/java/jdk1.5.x.x My aim is as follows: To check whether the symbolic exists or not To get the value of the directory it is pointing To use regular expression instead of using if-else statement in the code. The link will be in /usr/tmp . I wrote some code in Perl which is as follows: $filename = "/usr/local/java"; if (-l $filename) { print "File exists \n"; } else { print "Not \n"; } But in case java is

Turning RewriteEngine on creates 403 error--how to turn on FollowSymLinks?

风流意气都作罢 提交于 2019-12-05 15:34:24
I am working with the built-in Apache2 on OSX. I moved the document root to a folder on my desktop and made sure that _www and everyone have read access. It works fine and great, PHP works, everything works until I add a .htaccess with this line only: RewriteEngine on As soon as I do that, everything in the directory with the file is 403 Forbidden: Forbidden You don't have permission to access /dir/file.txt on this server. Apache logs show this error: [error] [client 127.0.0.1] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /Users

Symbolic links in TFS 2010 Source Control?

好久不见. 提交于 2019-12-05 13:18:31
问题 As far as I know, Team Foundation Server 2010's source control (and prior versions) doesn't support linking (Symbolic links) of files. Linking (per Visual SourceSafe) was the concept of providing one "hard" file in a folder, and then "linking" to it in other locations - exactly like file system hard links are designed. Does anyone know if files can be linked at all? I realise it is not a good practice in general, but I have some scenarios where it makes sense. According to an answer in this

How to make a symlink in Java when running in Linux?

落爺英雄遲暮 提交于 2019-12-05 10:53:00
问题 How to make a symlink in Java/JVM when running in Linux? Are there any other ways to this than using Java Native Interface (JNI) or java.lang.Runtime.exec("/bin/ln -s /some/path symlink") ? Creating a symlink is very platform dependant, but I mostly care about running on Linux, nice bonus would be if a shortcut would be created in Windows. 回答1: The JDK 7 includes (via NIO.2) a class called Files that provides a createSymbolicLink() method. Previous versions don't provide any built-in way to

Is there a way to do symbolic links to the blob data when using Azure Storage to avoid duplicate blobs?

混江龙づ霸主 提交于 2019-12-05 10:25:17
I have a situation where a user is attaching files within an application, these files are then persisted to Azure Blob storage, there is a reasonable likelihood that there are going to be duplicates and I want to put in place a solution where duplicate blobs are avoided. My first thought is to just name the blob as filename_hash but that only captures a subset of duplicates, then filesize_hash was then next thought. In doing this though it seems like I am losing some of the flexibility of the blob storage to represent the position in a hierarchy of the file, see: Windows Azure: How to create

How do I copy symbolic links in Perl?

╄→гoц情女王★ 提交于 2019-12-05 09:59:40
How do I copy a symbolic link (and not the file it points to) in a Perl program while preserving all of the symbolic link attributes (such as owner and permissions)? In Perl you can use the readlink() function to find out the destination of a symlink. You can also use the lstat() function to read the permissions of the symlink (as opposed to stat() which will read the details of the file pointed to by the symlink). Actually setting the ownership on the new symlink can't be done without extra help as Perl doesn't expose the lchown() system call. For that you can use the Perl Lchown module from

How do you determine the path of the file that a symlink points to?

孤人 提交于 2019-12-05 09:58:11
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? The readlink function. Do a man 2 readlink . This function is part of the Posix API, so it should work on almost any Unix. If the path starts with a '/' , then its an absolute symlink and you have the full absolute path of the file to which it refers (which may be another symbolic link, and you'll have to repeat the process again). If the path does not start with ' / ', then it's a relative link and is interpreted relative to the

How to add symlinks to git repository on Windows?

眉间皱痕 提交于 2019-12-05 04:55:27
I compile binaries for OS X using GitHub' s electron environment and want to add the output to a git repository. I tried git add . error: readlink("sulu.app/Contents/Frameworks/Electron Framework.framework/Electron Framework"): Function not implemented error: unable to index file sulu.app/Contents/Frameworks/Electron Framework.framework/Electron Framework fatal: adding files failed Any idea to work around this? Windows command mklink /H "Link_File_Path" "Target_File_Path" Use above command to create a hard link for all your output files. That will work. I did similar stuff for git hooks. Refer