diff options
| author | theimpostor <sahirhoda@gmail.com> | 2023-08-07 08:22:04 -0500 |
|---|---|---|
| committer | theimpostor <sahirhoda@gmail.com> | 2023-08-07 08:22:04 -0500 |
| commit | ba4b74f3a1d6cfd9548051033ac5b542d2c0d481 (patch) | |
| tree | 1285feb84768b10a02b8844309ee319eb83ecb9a | |
| parent | 3647790710b86437eccf5867c9d2d4eb860eb1e4 (diff) | |
check files readable for copy
| -rw-r--r-- | main.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -106,6 +106,14 @@ func copy(fnames []string) error { // copy if len(fnames) == 0 { fnames = []string{"-"} + } else { + for _, fname := range fnames { + if f, err := os.Open(fname); err != nil { + return err + } else { + f.Close() + } + } } slog.Debug("Beginning osc52 copy operation") |
