Skip to content

Tag: symlink

Usage of lstat / stat from the linux kernel?

I’m hoping someone can fact check my assumptions on the question “Can lstat and/or stat be called form the Linux kernel 3.10.0 in Centos 7. I’ve been searching and reading as much as I can find and have only been able to confuse myself. I can’t tell if the examples I am finding are ava…

How to make a ~/public_html in WHM/cPanel symlink

I’m using Rocketeer for deployment on a server that is powered by WHM/cPanel. I’m having an issue where I’m deploying my app to ~/mysite.com where Rockteer adds a version of the site in ~/mysite.com/releases/GIT-COMMIT-HASH and symlinks ~/mysite.com/current to the latest release. I’m t…

Retrieve path of symbolic link

I want to store the path of the file the symbolic link is pointing to into bufff. This works with my current implementation using readlink but it grabs extra data I don’t need because my bufsize is arbitrarily valued. I’m not sure how to size it according to the path of what the symbolic link poin…

Change the target of a symlink with PHP

How can I change the target of a symlink with PHP? Thanks. Answer You can delete the existing link using unlink function and recreate the link to the new target using the symlink function. You need to do error checking for each of these.