symlink

How to move a symlink to the trash?

与世无争的帅哥 提交于 2019-12-01 18:23:45
I don't see any options for the FSPathMoveObjectToTrashSync() function for not following links. Here is what I have tried Create a link and a file [ 21:32:41 /tmp ] $ touch my_file [ 21:32:45 /tmp ] $ ln -s my_file my_link [ 21:32:52 /tmp ] $ la total 8 drwxrwxrwt 12 root wheel 408 17 Maj 21:32 . drwxr-xr-x@ 6 root wheel 204 9 Sep 2009 .. -rw-r--r-- 1 neoneye wheel 0 17 Maj 21:32 my_file lrwxr-xr-x 1 neoneye wheel 7 17 Maj 21:32 my_link -> my_file Move the link to the trash OSStatus status = FSPathMoveObjectToTrashSync( "/tmp/my_link", NULL, kFSFileOperationDefaultOptions ); NSLog(@"status: %i

Reading a symbolic link in kernel-space

强颜欢笑 提交于 2019-12-01 17:01:31
I'm writing a LKM and need to find out where a specific symlink is pointing to. Basically I need the functionality of the syscall readlinkat (or readlink ) but in kernel-space. Is there an easy way to do this? Using readlinkat directly is not working for me, I'm always getting EFAULT (I guess this is because my buffer is obviously in kernel memory space and not in user-space). Firstly, you can't use user space system calls( readlinkat() or readlink() ) directly in your kernel module. Rather you need to use exported function / symbol within the kernel space. Next, may want to look into the

Symlinks not working when link is made in another directory?

≡放荡痞女 提交于 2019-12-01 16:25:17
Wow, I've never really used symlinks that much before, but this is really boggling: bash-3.2$ echo "weird" > original.txt bash-3.2$ mkdir originals bash-3.2$ mv original.txt originals/ bash-3.2$ cat originals/original.txt weird bash-3.2$ mkdir copies bash-3.2$ ln -s originals/original.txt copies/copy.txt bash-3.2$ cat copies/copy.txt cat: copies/copy.txt: No such file or directory bash-3.2$ ls copies/copy.txt copies/copy.txt bash-3.2$ ls -l copies/copy.txt lrwxr-xr-x 1 zach staff 22 Dec 22 01:23 copies/copy.txt -> originals/original.txt bash-3.2$ cat originals/original.txt weird bash-3.2$ cat

Symlinks not working when link is made in another directory?

戏子无情 提交于 2019-12-01 16:04:48
问题 Wow, I've never really used symlinks that much before, but this is really boggling: bash-3.2$ echo "weird" > original.txt bash-3.2$ mkdir originals bash-3.2$ mv original.txt originals/ bash-3.2$ cat originals/original.txt weird bash-3.2$ mkdir copies bash-3.2$ ln -s originals/original.txt copies/copy.txt bash-3.2$ cat copies/copy.txt cat: copies/copy.txt: No such file or directory bash-3.2$ ls copies/copy.txt copies/copy.txt bash-3.2$ ls -l copies/copy.txt lrwxr-xr-x 1 zach staff 22 Dec 22 01

Ignoring symlinks in git

泪湿孤枕 提交于 2019-12-01 15:20:49
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 LaTeX files on both windows and linux. On linux, I have a large number of style files stored outside the repo, and symlinked to from a bunch of places. It'll work fine if git turns them into shortcuts on windows (I have the same surrounding directory/file structure), or if git ignores them completely, and doesn't check them out (I have the style

Ignoring symlinks in git

妖精的绣舞 提交于 2019-12-01 14:13:48
问题 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 LaTeX files on both windows and linux. On linux, I have a large number of style files stored outside the repo, and symlinked to from a bunch of places. It'll work fine if git turns them into shortcuts on windows (I have the same surrounding

Symlink created with mklink not working with IIS7.5 — Windows 7

怎甘沉沦 提交于 2019-12-01 08:29:15
So while in my IIS root directory (c:\inetpub\wwwroot) I've created a symlink to a network drive using: mdlink /D truthuniversal "U:\Truth Universal Full Site\public" The symlink was created just fine, and if I issue the cd truthuniversal command, while in the IIS root dir, I do indeed end up in the "U:\Truth Universal Full Site\public" directory area. My problem is that when I type: http://localhost/truthuniversal in my browser's address bar IIS does not serve the index page which resides in the public directory. Instead, I get the following error: Server Error in Application "DEFAULT WEB

Symlink created with mklink not working with IIS7.5 — Windows 7

随声附和 提交于 2019-12-01 06:19:06
问题 So while in my IIS root directory (c:\inetpub\wwwroot) I've created a symlink to a network drive using: mdlink /D truthuniversal "U:\Truth Universal Full Site\public" The symlink was created just fine, and if I issue the cd truthuniversal command, while in the IIS root dir, I do indeed end up in the "U:\Truth Universal Full Site\public" directory area. My problem is that when I type: http://localhost/truthuniversal in my browser's address bar IIS does not serve the index page which resides in

How do I create a symlink in Windows Vista?

不问归期 提交于 2019-12-01 03:49:53
问题 I am looking to create symlinks (soft links) from Java on a Windows Vista/ 2008 machine. I'm happy with the idea that I need to call out to the JNI to do this. I am after help on the actual C code though. What is the appropriate system call to create the link? Pointers to some good documentation on this subject would be very much appreciated. 回答1: Symbolic links in Windows are created using the CreateSymbolicLink API Function, which takes parameters very similar to the command line arguments

Java: check symbolic link file existence

拥有回忆 提交于 2019-11-30 22:59:06
问题 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 exists. Is there really no way to realize this except JNI? 回答1: looks that way for now... unless you go with openjdk http://openjdk.java.net/projects/nio/javadoc/java/nio/file/attribute/BasicFileAttributes.html#isSymbolicLink() 回答2: It is slow but