mirror of
https://github.com/restic/restic.git
synced 2026-10-18 07:28:12 +00:00
fs: rewrite Reader to build fs tree up front
This adds proper support for filenames that include directories. For example, `/foo/bar` would result in an error when trying to open `/foo`. The directory tree is now build upfront. This ensures let's the directory tree construction be handled only once. All accessors then only have to look up the constructed directory entries.
This commit is contained in:
1 parent
3d14e92905
commit
3a995172b7
5 files changed
+177
-117
No files matched your search
@@ -591,12 +591,10 @@ func runBackup(ctx context.Context, opts BackupOptions, gopts GlobalOptions, ter
|
||||
return err
|
||||
}
|
||||
}
|
||||
targetFS = &fs.Reader{
|
||||
ModTime: timeStamp,
|
||||
Name: filename,
|
||||
Mode: 0644,
|
||||
ReadCloser: source,
|
||||
}
|
||||
targetFS = fs.NewReader(filename, source, fs.ReaderOptions{
|
||||
ModTime: timeStamp,
|
||||
Mode: 0644,
|
||||
})
|
||||
targets = []string{filename}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user