File tree 1 file changed +13
-3
lines changed
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ func (f *File) Mode() os.FileMode {
83
83
if f .IsDir () {
84
84
mode |= os .ModeDir
85
85
}
86
+ if f .de .FileFlags & 32 != 0 {
87
+ mode |= os .ModeSymlink
88
+ }
86
89
return mode
87
90
}
88
91
@@ -162,14 +165,21 @@ func (f *File) GetChildren() ([]*File, error) {
162
165
continue
163
166
}
164
167
165
- // use alternative name from Rock Ridge extension, if provided
168
+ // use Rock Ridge extension to get full name and symbolic link flag
166
169
wrkBuf := newDE .SystemUse
167
170
for tag , buf := getTag (wrkBuf ); tag != "" ; tag , buf = getTag (wrkBuf ) {
168
- if tag == "NM" {
171
+ if tag == "PX" {
172
+ fileMode , err := UnmarshalInt32LSBMSB (buf [1 :9 ])
173
+ if err != nil {
174
+ return nil , err
175
+ }
176
+ if fileMode & 0120000 == 0120000 {
177
+ newDE .FileFlags |= 32 // this bit a reserved, set to indicate a symlink
178
+ }
179
+ } else if tag == "NM" {
169
180
if buf [1 ] == 0x00 { // any set flag value means that alternative name shouldn't be used
170
181
newDE .Identifier = string (buf [2 :])
171
182
}
172
- break
173
183
}
174
184
wrkBuf = wrkBuf [len (buf )+ 3 :]
175
185
}
You can’t perform that action at this time.
0 commit comments