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 } [ { t } [
[ [
[ ftp-get ] ! give client its own directory so we don't overwrite the ftp server's file
[ path>> file-name ascii file-contents ] bi [
[ ftp-get ]
[ path>> file-name ascii file-contents ] bi
] with-test-directory
] test-ftp-server test-file-contents = ] test-ftp-server test-file-contents =
] unit-test ] unit-test
[ [
[ [
"/" >>path ! give client its own directory so we don't overwrite the ftp server's file
[ ftp-get ] [
[ path>> file-name ascii file-contents ] bi "/" >>path
[ ftp-get ]
[ path>> file-name ascii file-contents ] bi
] with-test-directory
] test-ftp-server test-file-contents = ] test-ftp-server test-file-contents =
] must-fail ] must-fail