CheckFileIsExist returns true if the file exists (including when unreadable due to permissions).
(filename string)
| 43 | |
| 44 | // CheckFileIsExist returns true if the file exists (including when unreadable due to permissions). |
| 45 | func CheckFileIsExist(filename string) bool { |
| 46 | _, err := os.Stat(filename) |
| 47 | return err == nil || !os.IsNotExist(err) |
| 48 | } |
| 49 | |
| 50 | // CreateFile creates an empty file with the specified permissions atomically. |
| 51 | func CreateFile(filePath string, perm fs.FileMode) error { |
no outgoing calls