You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/eBook/07.5.md
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,26 @@
1
1
# 7.5 Files
2
2
3
-
File is must-have object in every single computer device, and web applications also have many usage with files. In this section, we're going to learn how to operate files in Go.
3
+
Files are must-have objects on every single computer device. It won't come as any surprise to you that web applications also make heavy use of them. In this section, we're going to learn how to operate on files in Go.
4
4
5
5
## Directories
6
6
7
-
Most of functions of file operations is in package`os`, here are some functions about directories:
7
+
In Go, most of the file operation functions are located in the`os` package. Here are some directory functions:
8
8
9
9
- func Mkdir(name string, perm FileMode) error
10
10
11
-
Create directory with `name`, `perm` is permission, like 0777.
11
+
Create a directory with `name`. `perm` is the directory permissions, i.e 0777.
12
12
13
13
- func MkdirAll(path string, perm FileMode) error
14
14
15
15
Create multiple directories according to `path`, like `astaxie/test1/test2`.
16
16
17
17
- func Remove(name string) error
18
18
19
-
Remove directory with `name`, it returns error if it's not directory or not empty.
19
+
Removes directory with `name`. Returns error if it's not a directory or not empty.
20
20
21
21
- func RemoveAll(path string) error
22
22
23
-
Remove multiple directories according to `path`, it will not be deleted if `path` is a single path.
23
+
Removes multiple directories according to `path`. Directories will not be deleted if `path` is a single path.
0 commit comments