symlink

Create symbolic links on server without SSH available?

给你一囗甜甜゛ 提交于 2019-11-27 17:10:46
问题 I got excited when I saw the following post but it doesn't cover my case: Mount an FTP server locally Is there any way for me to create symbolic links on a remote server without having SSH access, possibly via some FTP hack? 回答1: Regular FTP is too abstract to know about symbolic links. If the server supports custom commands, it might let you send the unix shell commands directly. Not all servers support this but some of them do. If you have SFTP access (sometimes admins give users SFTP

How do I overcome the “The symbolic link cannot be followed because its type is disabled.” error when getting the target of a symbolic link?

浪尽此生 提交于 2019-11-27 17:10:00
Following on from a previous question , I am creating a symbolic link on a Server 2008 from a Vista machine using UNC paths. I can create the link just fine. I can go to the Server 2008 box and double click on the link in explorer to open the target file. What I cannot do though is use FileCreateW to get a handle to the UNC path link (from the Vista box). When I try it, it fails and GetLastError() returns error code 1463 (0x5B7), which is: The symbolic link cannot be followed because its type is disabled. How to enable its "type" in Server 2008 (assuming the error means what it says)?

How to check if a symlink exists

匆匆过客 提交于 2019-11-27 16:46:50
I'm trying to check if a symlink exists in bash. Here's what I've tried. mda=/usr/mda if [ ! -L $mda ]; then echo "=> File doesn't exist" fi mda='/usr/mda' if [ ! -L $mda ]; then echo "=> File doesn't exist" fi However, that doesn't work. If '!' is left out, it never triggers. And if '!' is there, it triggers every time. drysdam -L returns true if the "file" exists and is a symbolic link (the linked file may or may not exist). You want -f (returns true if file exists and is a regular file) or maybe just -e (returns true if file exists regardless of type). According to the GNU manpage , -h is

Remove a symlink to a directory

假装没事ソ 提交于 2019-11-27 16:33:23
I have a symlink to an important directory. I want to get rid of that symlink, while keeping the directory behind it. I tried rm and get back rm: cannot remove 'foo' . I tried rmdir and got back rmdir: failed to remove 'foo': Directory not empty I then progressed through rm -f , rm -rf and sudo rm -rf Then I went to find my back-ups. Is there a way to get rid of the symlink with out throwing away the baby with the bathwater? # this works rm foo # versus rm foo/ Basically, you need to tell it to delete a file, not delete a directory. I believe the difference between rm and rmdir exists because

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

拜拜、爱过 提交于 2019-11-27 14:44:49
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 target. I have found out that symbolic links are an implementation of reparse points, and so the reparse point functions can be used to obtain the target path. But the header files that I need to use reparse points appear to come with the Windows Driver Kit . Setting up this kit with VS2008 appears to be a non trivial task. Is there a nice simple

Commit symlink into subversion

≯℡__Kan透↙ 提交于 2019-11-27 14:38:54
问题 I'm tring to commit a symlink into subversion, but I get this error when I try to add the actual symlink: Can't replace 'path/to/symlink' with a node of a differing type; the deletion must be committed and the parent updated before adding 'path/to/symlink' 回答1: I read it as - you have to remove the file, commit, update, create symlink, add it, commit. And my guess is that you're trying to remove the file, create symlink, commit in one go. 回答2: svn delete x svn ci -m'blah' svn update ln -s

powershell to resolve junction target path

此生再无相见时 提交于 2019-11-27 14:37:08
In PowerShell, I need resolve the target path of a junction (symlink). for example, say I have a junction c:\someJunction whose target is c:\temp\target I tried variations of $junc = Get-Item c:\someJunction , but was only able to get c:\someJunction How do I find the target path of the junction, in this example c:\temp\target , of a given junction? Josh You can get the path by doing the following: Get-ChildItem -Path C:\someJunction Edit for finding the path and not the contents of the folder Add-Type -MemberDefinition @" private const int FILE_SHARE_READ = 1; private const int FILE_SHARE

Can I traverse symlinked directories in Ruby with a “**” glob?

元气小坏坏 提交于 2019-11-27 13:52:11
问题 In Ruby, Dir.glob("**/*.rb") (for instance) doesn't traverse symlinked directories. Is it possible to get the ** to traverse symlinks? I'm using two gems which find files this way, but I need them to see files within a symlinked directory. 回答1: Jonathan's clever and cunning approach is great, capable of slashing through hordes of symlinks with but a mere flick of a few asterisks, muahaha. However, it has the unfortunate side-effect of not returning immediate-child matches. An improved version

Cannot create a symlink inside of /usr/bin even as sudo

谁说我不能喝 提交于 2019-11-27 13:23:53
When I try to symlink a binary in my /usr/bin folder, I get an Operation not permitted error: sudo ln -s /usr/bin/python2.7 /usr/bin/python2 ln: /usr/bin/python2: Operation not permitted Even as sudo, I get this error. Gordon Davisson Why can't I symlink into /usr/bin ? El Capitan's new System Integrity Protection feature prevents changes to several core parts of OS X, including most of /usr/ , even by root. How can I still add executable files to my path? Local customizations, such as what you're doing, belong in /usr/local instead. The path /usr/local/bin doesn't exist by default, but you

How to check if a directory/file/symlink exists with one command in Ruby

空扰寡人 提交于 2019-11-27 12:58:09
Is there a single way of detecting if a directory/file/symlink/etc. entity (more generalized) exists? I need a single function because I need to check an array of paths that could be directories, files or symlinks. I know File.exists?"file_path" works for directories and files but not for symlinks (which is File.symlink?"symlink_path" ). The standard File module has the usual file tests available: RUBY_VERSION # => "1.9.2" bashrc = ENV['HOME'] + '/.bashrc' File.exist?(bashrc) # => true File.file?(bashrc) # => true File.directory?(bashrc) # => false You should be able to find what you want