mirror of
https://github.com/restic/restic.git
synced 2025-12-08 06:09:56 +00:00
Instead of rebasing my code, I decided to start fresh, since WithBlobUploader() has been introduced. changelog/unreleased/issue-5453: doc/045_working_with_repos.rst: the usual cmd/restic/cmd_copy.go: gather all snaps to be collected - collectAllSnapshots() run overall copy step - func copyTreeBatched() helper copySaveSnapshot() to save the corresponding snapshot internal/repository/repack.go: introduce wrapper CopyBlobs(), which passes parameter `uploader restic.BlobSaver` from WithBlobUploader() via copyTreeBatched() to repack(). internal/backend/local/local_windows.go: I did not touch it, but gofmt did: whitespace
31 lines
707 B
Go
31 lines
707 B
Go
package local
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/restic/restic/internal/errors"
|
|
)
|
|
|
|
// Can't explicitly flush directory changes on Windows.
|
|
func fsyncDir(_ string) error { return nil }
|
|
|
|
// Windows is not macOS.
|
|
func isMacENOTTY(_ error) bool { return false }
|
|
|
|
// We don't modify read-only on windows,
|
|
// since it will make us unable to delete the file,
|
|
// and this isn't common practice on this platform.
|
|
func setFileReadonly(_ string, _ os.FileMode) error {
|
|
return nil
|
|
}
|
|
|
|
func removeFile(f string) error {
|
|
// Reset read-only flag,
|
|
// as Windows won't let you delete a read-only file
|
|
err := os.Chmod(f, 0666)
|
|
if err != nil && !os.IsPermission(err) {
|
|
return errors.WithStack(err)
|
|
}
|
|
|
|
return os.Remove(f)
|
|
}
|