unlink removes files and unlike os.Remove, directories are kept.
(path string)
| 247 | |
| 248 | // unlink removes files and unlike os.Remove, directories are kept. |
| 249 | func unlink(path string) error { |
| 250 | // Ignore EINTR like os.Remove, see ignoringEINTR in os/file_posix.go |
| 251 | // for more details. |
| 252 | for { |
| 253 | err := syscall.Unlink(path) |
| 254 | if !errors.Is(err, syscall.EINTR) { |
| 255 | return err |
| 256 | } |
| 257 | } |
| 258 | } |