khenriks / mp3fs

FUSE-based transcoding filesystem from FLAC to MP3
http://khenriks.github.io/mp3fs/
GNU General Public License v3.0
382 stars 46 forks source link

Support symlinks with relative paths #44

Closed flight16 closed 4 years ago

flight16 commented 8 years ago

On OS X, symlinks with absolute paths work, but not relative paths.

For example:

ln -s ../Originals/song.flac ./song.flac

I'm almost certain this is because readlink() is only returning ../Originals/song.flac. I propose that if the file is a symlink realpath() is called to get the absolute path.

khenriks commented 6 years ago

You should still be able to access the original files, even if though don't show up with ls. In the same way, you should still be able to use the symlink to access the original file if that's what you want.

I don't think secretly changing symlinks to point to absolute paths makes sense. Symlinks aren't meant to update themselves in response to remounting a path elsewhere on the system.

khenriks commented 4 years ago

I think this should work regardless of whether the symlink is relative or absolute. Please let me know if it's not working and I'll take a look.