symlink

How do I build a debian package whose sources include symbolic links outside of the source tree?

时间秒杀一切 提交于 2019-12-10 20:23:17
问题 I have a project whose source includes symbolic links to other source trees (notably, the CppUTest framework). I need to build a debian package out of my project, but dpkg-source will not follow the symbolic links. Digging further, I believe this is because the default behavior for tar is not to dereference symbolic links unless explicitly told to (with -h ). I was unable to find a way to pass this extra option to tar when building the debian source tarball. So what am I doing wrong here? Is

Python os.walk and symlinks

最后都变了- 提交于 2019-12-10 19:37:40
问题 While fixing one user's answer on AskUbuntu , I've discovered a small issue. The code itself is straightforward : os.walk , recursively get sum of all files in the directory. But it breaks on symlinks : $ python test_code2.py $HOME Traceback (most recent call last): File "test_code2.py", line 8, in <module> space += os.stat(os.path.join(subdir, f)).st_size OSError: [Errno 2] No such file or directory: '/home/xieerqi/.kde/socket-eagle' Question then is, how do I tell python to ignore those

softlinks atime and mtime modification

隐身守侯 提交于 2019-12-10 18:29:55
问题 Is it possible to change the atime and mtime of a symlink? I am trying to change it using the utime() function(C code) but instead it changes the time of destination files. Also if I do cp -dpr <src fldr> <<dest folder> (command line) [The src folder contains different symlinks.] the symlinks at destination are created with current timestamp. Doing a stat() on the symlink will give me the timing of destination file (in C code) but if we fire a stat command on command line it gives the

following symbolic links in C

妖精的绣舞 提交于 2019-12-10 17:34:39
问题 I'm looking to write a C program which, given the name of symbolic link, will print the name of the file or directory the link points to. Any suggestions on how to start? 回答1: Make sure that you have an environment which supports POSIX functions, include unistd.h and then use the readlink function. 回答2: The readlink() function that has been mentioned is part of the answer. However, you should be aware of its horrid interface (it does not null terminate the response string!). You might also

symlink in particular directory using rpm spec

馋奶兔 提交于 2019-12-10 17:21:42
问题 rpm created using spec file will create directory "directory1" and all files in /var/lib/directory1. For another use case i want to create another directory in "/var/lib" which should be a symlink to directory1. eg: cd /var/lib/ ls -la directory2 -> directory1 directory1 how is it possible to do achieve this without using absolute paths in spec file? 回答1: %install mkdir -p %{buildroot}/%{_sharedstatedir}/directory1 ln -s directory1 %{buildroot}/%{_sharedstatedir}/directory2 %files %{

canonicalize a path name on solaris

半世苍凉 提交于 2019-12-10 15:55:54
问题 On a GNU system I would just use readlink -f $SOME_PATH , but Solaris doesn't have readlink. I'd prefer something that works well in bash, but other programs are ok if needed. Edit: The best I've come up with so far uses cd and pwd, but requires some more hackery to deal with files and not just directories. cd -P "$*" REAL_PATH=`pwd` 回答1: Does this help? From the referenced page: Create a file called canonicalize with these contents: #!/bin/bash cd -P -- "$(dirname -- "$1")" && printf '%s\n'

Remove git-annex repository from file tree

↘锁芯ラ 提交于 2019-12-10 15:16:34
问题 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 whole bunch of symlinks. Every single file in my whole tree is now symlinked into .git/annex/objects ! This is messing up my application which depends on files not being symlinks. My question is, how do I get rid of git-annex and restore my file system

Laravel Storage symlink

不打扰是莪最后的温柔 提交于 2019-12-10 14:22:19
问题 I'm trying to access files that are stored in storage/app/.../.../file.png. I have created a symlink, linking my storage folder to public/storage. When I try to access the appropriate file, my server throws a 404, saying file not found. Clearly I'm not accessing it the right way but I dont know what to change. <img src="{{asset('storage/app/puppy/18/ax2Fk08nyWrV6TwTOnsXNCkNGuIdFebB7TTfPYGb.png')}}" alt=""> 回答1: when you create symlink in laravel then it create symlink of storage/app/public

How to create symlink with Haskell?

大憨熊 提交于 2019-12-10 14:04:12
问题 How to create a symlink with Haskell? The directory package to my knowledge does not provide a way to do it. 回答1: Creating a symbolic link is non-portable. For example, the creation symbolic links on Windows is re­strict­ed 1 . Therefore it does not fit into directory providing "a basic set of operations for ma­nip­u­lat­ing files and directories in a portable way" (emphasis mine). This affects all platform independent packages. The platform specific package unix provides that functionality

File.Copy() and Symbolic Links

僤鯓⒐⒋嵵緔 提交于 2019-12-10 12:46:33
问题 I want to copy a file to a new file name. Sometimes the source file might be a symbolic (file) link, created with mklink C:\MyPath\ThisIsASymbolicLink.xml C:\MyPath\ThisIsTheOriginal.xml I'm using this code: string from = @"C:\MyPath\ThisIsASymbolicLink.xml"; string to = @"C:\MyPath\WantCopyOfOriginalFileHere.xml"; File.Copy(from, to, true); However, I receive an IOException The name of the file cannot be resolved by the system. when the from file is really a symbolic link. How can I code for