Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to modify a symlink in place?

ln -fs a b

This doesn't count, since it is unlinking and creating a new symlink (neither is it atomic, but that's a different story).

Research suggests that this is not possible, but I'd like to get a solid answer if this is the case and WHY this is the case.

If it is not immediately obvious from the reason why it isn't possible, I'd also like to know what it would take to make it possible.

share|improve this question
ln -sf file1 file2 works for me. Do you mean something else? – ott-- Jul 20 '13 at 22:29
@ott-- If you read my question, you'll know it is not in place. For example, if you stat it before and after, the inode is different. It's like saying you can edit a file in place with rm old; cat stuff > old. – darkfeline Jul 20 '13 at 22:50
I realized that later. You need to add a new system call to the linux kernel. – ott-- Jul 20 '13 at 22:56
Thanks. I have an idea what the problem is now (the linux kernel simply doesn't provide any syscalls that could do what I want). It'd save me a lot of internal debate on what to do if you could write an answer =). Do you know why a syscall doesn't exist? Is there a practical reason or just no one thought of it at the time the syscalls were standardized? – darkfeline Jul 21 '13 at 0:46

You must log in to answer this question.

Browse other questions tagged .