ftp.server: Don't fetch to the same directory we serve from or else it will overwrite the file. Race condition, only shows up on Windows for some reason.

locals-and-roots
Doug Coleman 2016-04-15 15:52:06 -07:00
parent 97e87f4a05
commit 099e142200
1 changed files with 11 additions and 5 deletions

View File

@ -20,16 +20,22 @@ CONSTANT: test-file-contents "Files are so boring anymore."
{ t } [
[
[ ftp-get ]
[ path>> file-name ascii file-contents ] bi
! give client its own directory so we don't overwrite the ftp server's file
[
[ ftp-get ]
[ path>> file-name ascii file-contents ] bi
] with-test-directory
] test-ftp-server test-file-contents =
] unit-test
[
[
"/" >>path
[ ftp-get ]
[ path>> file-name ascii file-contents ] bi
! give client its own directory so we don't overwrite the ftp server's file
[
"/" >>path
[ ftp-get ]
[ path>> file-name ascii file-contents ] bi
] with-test-directory
] test-ftp-server test-file-contents =
] must-fail