From 829ed818141656db7ccf56920aa58b19ce6717f1 Mon Sep 17 00:00:00 2001 From: Vincent Vanackere Date: Thu, 14 Sep 2023 14:55:14 +0200 Subject: [PATCH] iso9660: add basic symlink support --- filesystem/iso9660/directoryentry.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/filesystem/iso9660/directoryentry.go b/filesystem/iso9660/directoryentry.go index 1f694781..a6f538e0 100644 --- a/filesystem/iso9660/directoryentry.go +++ b/filesystem/iso9660/directoryentry.go @@ -482,9 +482,24 @@ func (de *directoryEntry) Size() int64 { // Mode() FileMode // file mode bits func (de *directoryEntry) Mode() os.FileMode { + for _, ext := range de.extensions { + if s, ok := ext.(rockRidgeSymlink); ok && !s.continued { + return 0o755 | os.ModeSymlink + } + } return 0o755 } +// Readlink tries to return the target link, only valid for symlinks +func (de *directoryEntry) ReadLink() (string, bool) { + for _, ext := range de.extensions { + if s, ok := ext.(rockRidgeSymlink); ok && !s.continued { + return s.name, true + } + } + return "", false +} + // ModTime() time.Time // modification time func (de *directoryEntry) ModTime() time.Time { return de.creation