diff options
author | Steve Bennett <steveb@workware.net.au> | 2020-05-04 22:19:53 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2020-05-04 23:04:09 +1000 |
commit | 9366d8f76430fac4c64be6dd99e44a13ed4c2fb9 (patch) | |
tree | ea0af6f35b44e1b441c3b2de9f9cc286929cfb6c /jim-file.c | |
parent | b58ccf39a730dba009abbbae19cb55e0200d37ac (diff) | |
download | jimtcl-9366d8f76430fac4c64be6dd99e44a13ed4c2fb9.zip jimtcl-9366d8f76430fac4c64be6dd99e44a13ed4c2fb9.tar.gz jimtcl-9366d8f76430fac4c64be6dd99e44a13ed4c2fb9.tar.bz2 |
tests: Fixes to recent tests for windows
Mostly just avoiding running certain tests, but also:
- rename() won't overwrite an existing file on Windows
- ensure that eof returns 0 or 1
- in aio.test, create and read the file in binary mode
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-file.c')
-rw-r--r-- | jim-file.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -607,7 +607,12 @@ static int file_cmd_rename(Jim_Interp *interp, int argc, Jim_Obj *const *argv) argv[1]); return JIM_ERR; } - +#if ISWINDOWS + if (access(dest, F_OK) == 0) { + /* Windows won't rename over an existing file */ + remove(dest); + } +#endif if (rename(source, dest) != 0) { Jim_SetResultFormatted(interp, "error renaming \"%#s\" to \"%#s\": %s", argv[0], argv[1], strerror(errno)); |