-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample_test.go
48 lines (38 loc) · 936 Bytes
/
example_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright 2017 The go-darwin Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin
package apfs
import (
"fmt"
"log"
"os"
)
func ExampleCopyFile() {
src, dst := os.Args[1], os.Args[2]
state := CopyFileStateAlloc()
defer func() {
if err := CopyFileStateFree(state); err != nil {
log.Fatal(err)
}
}()
cloned, err := CopyFile(src, dst, state, COPYFILE_CLONE)
if err != nil {
log.Fatal(err)
}
fmt.Printf("isCloned: %v", cloned)
// Outpt: true // or false
}
func ExampleFcopyFile() {}
func ExampleCopyFileStateAlloc() {}
func ExampleCopyFileStateFree() {}
func ExampleCopyFileStateGet() {}
func ExampleCloneFile() {
src, dst := os.Args[1], os.Args[2]
err := CloneFile(src, dst, CLONEFILE_FLAG(0))
if err != nil {
log.Fatal(err)
}
}
func ExampleCloneFileAt() {}
func ExampleFcloneFileAt() {}