FileIsReadable checks to make sure a file exists and is readable
(name string)
| 134 | |
| 135 | // FileIsReadable checks to make sure a file exists and is readable |
| 136 | func FileIsReadable(name string) bool { |
| 137 | file, err := os.OpenFile(name, os.O_RDONLY, 0666) |
| 138 | if err != nil { |
| 139 | return false |
| 140 | } |
| 141 | file.Close() |
| 142 | return true |
| 143 | } |
| 144 | |
| 145 | // PurgeDirectory removes all of the contents of a given |
| 146 | // directory, leaving the directory itself intact. |
no outgoing calls
no test coverage detected