Skip to content

Commit

Permalink
iso9660: add basic symlink support (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanackere authored Sep 19, 2023
1 parent 22d22fd commit 94310d8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions filesystem/iso9660/directoryentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 94310d8

Please sign in to comment.