File tree 2 files changed +17
-15
lines changed
2 files changed +17
-15
lines changed Original file line number Diff line number Diff line change
1
+ package fs
2
+
3
+ import "fmt"
4
+
5
+ // A FileExistsError is returned when an operation cannot be completed due to a
6
+ // file already existing.
7
+ type FileExistsError struct {
8
+ path string
9
+ }
10
+
11
+ func newFileExistsError (path string ) FileExistsError {
12
+ return FileExistsError {path : path }
13
+ }
14
+
15
+ func (e FileExistsError ) Error () string {
16
+ return fmt .Sprintf ("operation not allowed, file %q exists" , e .path )
17
+ }
Original file line number Diff line number Diff line change 3
3
package fs
4
4
5
5
import (
6
- "fmt"
7
6
"os"
8
7
"syscall"
9
8
)
10
9
11
- // A FileExistsError is returned when an operation cannot be completed due to a
12
- // file already existing.
13
- type FileExistsError struct {
14
- path string
15
- }
16
-
17
- func newFileExistsError (path string ) FileExistsError {
18
- return FileExistsError {path : path }
19
- }
20
-
21
- func (e FileExistsError ) Error () string {
22
- return fmt .Sprintf ("operation not allowed, file %q exists" , e .path )
23
- }
24
-
25
10
// SyncDir flushes any file renames to the filesystem.
26
11
func SyncDir (dirName string ) error {
27
12
// fsync the dir to flush the rename
You can’t perform that action at this time.
0 commit comments