Skip to main content
added 118 characters in body
Source Link
user313992
user313992

That's totally file system dependent.

Usually the the symlink target is stored as-is within the extra space of an inode block, the same way small directories and small files are. There's no need for any special data format -- the file mode bits already determine that it's a symlink and should be treated as such. The target is the "actual content": you can use readlink -n /path/to | hexdump if you really want to use hexdump.

When calling lstat(2) on a symlink, st.st_size will contain the length of the target (not including any terminating NUL byte).

That's totally file system dependent.

Usually the the symlink target is stored as-is within the extra space of an inode block, the same way small directories and small files are. There's no need for any special data format -- the file mode bits already determine that it's a symlink and should be treated as such.

When calling lstat(2) on a symlink, st.st_size will contain the length of the target (not including any terminating NUL byte).

That's totally file system dependent.

Usually the the symlink target is stored as-is within the extra space of an inode block, the same way small directories and small files are. There's no need for any special data format -- the file mode bits already determine that it's a symlink and should be treated as such. The target is the "actual content": you can use readlink -n /path/to | hexdump if you really want to use hexdump.

When calling lstat(2) on a symlink, st.st_size will contain the length of the target (not including any terminating NUL byte).

Source Link
user313992
user313992

That's totally file system dependent.

Usually the the symlink target is stored as-is within the extra space of an inode block, the same way small directories and small files are. There's no need for any special data format -- the file mode bits already determine that it's a symlink and should be treated as such.

When calling lstat(2) on a symlink, st.st_size will contain the length of the target (not including any terminating NUL byte).