Improve error handling and setting of xattr and file flags

- Improve error handling of file flags and xattrs. You now get warnings
- file flags on *BSD/Darwin use a mask and combine with the user/superuser
mask to prevent spurious warnings. The mask is not yet implemented as
a preference
- error handling/report for reading special files
- bump to go 1.20 for errors.Join
This commit is contained in:
2023-10-05 21:43:02 -05:00
parent 7df1ba5d82
commit 42ee20a9e1
9 changed files with 382 additions and 284 deletions

View File

@@ -116,15 +116,32 @@ func (entry *Entry) getHardLinkKey(f os.FileInfo) (key listEntryLinkKey, linked
return
}
func (entry *Entry) ReadAttributes(top string) {
func (entry *Entry) ReadAttributes(fullPath string, fi os.FileInfo) error {
return nil
}
func (entry *Entry) SetAttributesToFile(fullPath string) {
func (entry *Entry) ReadFileFlags(fullPath string, fileInfo os.FileInfo) error {
return nil
}
func (entry *Entry) ReadSpecial(fileInfo os.FileInfo) bool {
return true
func (entry *Entry) SetAttributesToFile(fullPath string) error {
return nil
}
func (entry *Entry) RestoreEarlyDirFlags(fullPath string, mask uint32) error {
return nil
}
func (entry *Entry) RestoreEarlyFileFlags(f *os.File, mask uint32) error {
return nil
}
func (entry *Entry) RestoreLateFileFlags(fullPath string, fileInfo os.FileInfo, mask uint32) error {
return nil
}
func (entry *Entry) ReadSpecial(fullPath string, fileInfo os.FileInfo) error {
return nil
}
func (entry *Entry) IsSameSpecial(fileInfo os.FileInfo) bool {
@@ -161,11 +178,3 @@ func SplitDir(fullPath string) (dir string, file string) {
func excludedByAttribute(attributes map[string][]byte) bool {
return false
}
func (entry *Entry) RestoreEarlyDirFlags(path string) error {
return nil
}
func (entry *Entry) RestoreEarlyFileFlags(f *os.File) error {
return nil
}