1 USING: calendar ftp.server io.encodings.ascii io.files
2 io.files.unique namespaces threads tools.test kernel
3 io.servers ftp.client accessors urls
4 io.pathnames io.directories sequences fry io.backend
6 FROM: ftp.client => ftp-get ;
9 CONSTANT: test-file-contents "Files are so boring anymore."
11 : create-test-file ( -- path )
13 "ftp.server" "test" make-unique-file
14 [ ascii set-file-contents ] [ normalize-path ] bi ;
16 : test-ftp-server ( quot -- )
18 current-temporary-directory get
25 create-test-file >>path
27 ] with-threaded-server
28 ] cleanup-unique-directory ; inline
34 [ ftp-get ] [ path>> file-name ascii file-contents ] bi
35 ] cleanup-unique-working-directory
36 ] test-ftp-server test-file-contents =
44 [ ftp-get ] [ path>> file-name ascii file-contents ] bi
45 ] cleanup-unique-working-directory
46 ] test-ftp-server test-file-contents =