symlink

Have script path with unresolved symlinks in PHP?

梦想的初衷 提交于 2019-12-25 07:35:14
问题 Let's say we have a web directory with the following paths: framework/ index.php ... instance/ index.php -> ../framework/index.php (symlink) ... If we now make a request for (...)/instance/index.php PHP will resolve the symlinks and set __FILE__ as (...)/framework/index.php Is there a way around this so e.g. dirname(__FILE__) would be (...)/instance ? EDIT: Since it has been pointed out, I'm actually not sure if PHP itself is resolving the links or something else. In my case I'm using nginx

Symlink with Files.createSymbolicLink (Java 7) in RHEL 5

与世无争的帅哥 提交于 2019-12-25 05:27:20
问题 I want to create a symlink in RHEL 5 using Java. In java6 createSymbolicLink have only two parameters. But in case of Java7 FileAttribute has been included along with the parameters, ie a total of three parameters. public static Path createSymbolicLink(Path link, Path target, FileAttribute... attrs) throws IOException Creates a symbolic link to a target (optional operation). The target parameter is the target of the link. It may be an absolute or relative path and may not exist. When the

Ubuntu listing up files recursively, detecting sym-links

两盒软妹~` 提交于 2019-12-25 02:28:59
问题 I'm trying to list up my local file-system recursively using dirent.h . In order to prevent from following sym-links, I'm using the sys/stat.h header. In the following you can find my SSCCE program. /** * coding: utf-8 * * Copyright (C) 2013, Niklas Rosenstein * * listdir.c - List up directories and file-content recursively. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <dirent.h> #include <sys/stat.h> void list_dir(const char* directory_name) { DIR* directory_handle

filetype() returns dir for symlinks on Windows 7

回眸只為那壹抹淺笑 提交于 2019-12-25 00:23:12
问题 Regardless of the filetype() documentation, PHP 5.4.7 returns "dir" on symlinks on Windows 7. What's the most reliable way to detect a symlink on Windows 7? 回答1: what does is_link() return in your case? maybe you can use that to test for links. The provided link ( http://php.net/manual/en/function.is-link.php ) contains a workaround for Windows in the first comment. It's ugly, but I guess it does the job. 来源: https://stackoverflow.com/questions/13379645/filetype-returns-dir-for-symlinks-on

Hudson doesn't checkout using symlinks when using SVN (Subversion)

天大地大妈咪最大 提交于 2019-12-24 10:39:05
问题 The problem is that when Hudson checks out the files, it doesn't use symlinks. I've tried the svn13 and svn14 plug ins, but neither worked. 回答1: In linux, edit your /etc/init.d/hudson script file: Look for a line that looks like: $SU $HUDSON_USER --shell=/bin/bash -c "$DAEMON $DAEMON_ARGS -- $JAVA $JAVA_ARGS -jar $HUDSON_WAR $HUDSON_ARGS" || return 2 Change it to: $SU $HUDSON_USER --shell=/bin/bash -c "$DAEMON $DAEMON_ARGS -- $JAVA $JAVA_ARGS -Dsvnkit.symlinks=true -jar $HUDSON_WAR $HUDSON

Codeigniter Shared Resources - Opinions Wanted

天涯浪子 提交于 2019-12-24 10:37:43
问题 I run multiple websites all running off of a single installation of CodeIgniter on my server (separate application directories and a single system directory). This has been working fabulously and I don't see any reason to change it at this point. I find myself writing library classes to extend/override CI all of the time and many times if I find a bug or improve effeciency I have to go back to several websites to make the same adjustments at risk of a typo that breaks one of the websites.

C# CreateSymbolicLink doesn't follow through share access

。_饼干妹妹 提交于 2019-12-24 08:25:45
问题 I'm not sure if this is just a C# problem or a windows limitation. I have a server running my program which makes symbolic links in a shared folder. I can access through this link form the server with a normal disk path and the share path. If I try to access the same share with an other pc I can't access the linked files. I do can delete rename... the links but I can't follow the links. I already checked the acl of the link and the target files. Everyone should be able to access. I use the

Github Pages build failure

蹲街弑〆低调 提交于 2019-12-24 06:50:13
问题 I'm getting the following error about my Jekyll Github Pages reop: Your site is having problems building: A file was included in source/blog/index.html that is a symlink or does not exist in your _includes directory. This is the file it is complaining about, and the rest of the code is contained in that repo. I'm confused because the two files it is referencing are in the _includes folder, so what could be the issue? The page works fine when I build and run it locally. Thanks! 回答1: I

Create symlink inside a zipfile in memory using python

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 03:52:52
问题 I am looking for a way to create a zipfile in memory and include a symlink inside the zipfile. So far I have found this link and try the following code: from zipfile import ZipInfo from zipfile import ZipFile from zipfile import ZIP_DEFLATED, ZIP_STORED from cStringIO import StringIO import codecs buf = StringIO() zipfile = ZipFile( buf,'w') zipinfo = ZipInfo() zipinfo.filename = u'bundle/' zipinfo.compress_type = ZIP_STORED zipinfo.external_attr = 040755 << 16L # permissions drwxr-xr-x

sys_readlink fails EFAULT - alternative

半城伤御伤魂 提交于 2019-12-24 01:27:35
问题 I have the filedescriptor and like to get the real path. Currently i call sys_readlink /proc/self/fd/<fd> which works sometimes, but often i get an error -14 (-EFAULT). Here some Code: fs = get_fs(); set_fs(KERNEL_DS); err = sys_readlink(path, buf, size-1); set_fs(fs); Is there an alternative (probably better) way to get the realpath from kernel? 回答1: Get it from the filep in the task struct, e.g. something like struct task_struct *task; struct files_struct *files; struct file *file; char buf