Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'd be seriously tempted to make the decision, if I were writing this tool, that absolute symbolic links should have the same value when moved somewhere else in the filesystem -- the user wanted a very specific file. And, relative symbolic links should have the same value when moved somewhere else in the filesystem -- the user wanted the links to work regardless of where the directory tree was rooted.</p> <p>But if the two types of links were intermixed, then you'd have some more work to do -- which is where I assume you are now. (Unix programs are often not that forgiving about guessing a user's intent; if you just <code>readlink(2)</code> and <code>symlink(2)</code> exactly what the filesystem says, your program will never be <em>surprising</em>.)</p> <p><code>rsync(1)</code> might have some source code you can use -- or at least learn from. The <code>--safe-links</code> command line option causes <code>rsync</code> to <em>ignore</em> absolute symbolic links and relative symbolic links that point outside the trees it was instructed to copy. This isn't canonicalizing paths to relative as you wish but it may provide sufficient code for discovering which links point outside the directory tree in question.</p> <p>Slightly related; the Linux-specific <code>symlinkat(2)</code> system call may make it easier for you to create your symbolic links. (The family of <code>...at()</code> system calls are something like providing a process with multiple "current working directories" without forcing you to make all the <code>fchdir(2)</code> calls yourself.)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload