parent
dfb638e30c
commit
4684c9cacc
|
@ -21,8 +21,6 @@ M: object normalize-directory ;
|
||||||
|
|
||||||
HOOK: normalize-pathname io-backend ( str -- newstr )
|
HOOK: normalize-pathname io-backend ( str -- newstr )
|
||||||
|
|
||||||
M: object normalize-pathname ;
|
|
||||||
|
|
||||||
: set-io-backend ( io-backend -- )
|
: set-io-backend ( io-backend -- )
|
||||||
io-backend set-global init-io init-stdio ;
|
io-backend set-global init-io init-stdio ;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
IN: io.files.tests
|
IN: io.files.tests
|
||||||
USING: tools.test io.files io threads kernel continuations io.encodings.ascii
|
USING: tools.test io.files io threads kernel continuations
|
||||||
io.files.unique sequences strings accessors ;
|
io.encodings.ascii io.files.unique sequences strings accessors
|
||||||
|
io.encodings.utf8 ;
|
||||||
|
|
||||||
[ ] [ "blahblah" temp-file dup exists? [ delete-directory ] [ drop ] if ] unit-test
|
[ ] [ "blahblah" temp-file dup exists? [ delete-directory ] [ drop ] if ] unit-test
|
||||||
[ ] [ "blahblah" temp-file make-directory ] unit-test
|
[ ] [ "blahblah" temp-file make-directory ] unit-test
|
||||||
|
@ -130,6 +131,18 @@ io.files.unique sequences strings accessors ;
|
||||||
|
|
||||||
[ t ] [ cwd "misc" resource-path [ ] with-directory cwd = ] unit-test
|
[ t ] [ cwd "misc" resource-path [ ] with-directory cwd = ] unit-test
|
||||||
|
|
||||||
|
[ t ] [
|
||||||
|
temp-directory [ "hi" "test41" utf8 set-file-contents ] with-directory
|
||||||
|
temp-directory "test41" append-path utf8 file-contents "hi41" =
|
||||||
|
] unit-test
|
||||||
|
|
||||||
|
[ t ] [
|
||||||
|
temp-directory [
|
||||||
|
"test43" utf8 <file-writer> [ "hi43" write ] with-stream
|
||||||
|
] with-directory
|
||||||
|
temp-directory "test43" append-path utf8 file-contents "hi43" =
|
||||||
|
] unit-test
|
||||||
|
|
||||||
[ ] [ "append-test" temp-file dup exists? [ delete-file ] [ drop ] if ] unit-test
|
[ ] [ "append-test" temp-file dup exists? [ delete-file ] [ drop ] if ] unit-test
|
||||||
|
|
||||||
[ ] [ "append-test" temp-file ascii <file-appender> dispose ] unit-test
|
[ ] [ "append-test" temp-file ascii <file-appender> dispose ] unit-test
|
||||||
|
|
|
@ -272,6 +272,9 @@ DEFER: copy-tree-into
|
||||||
|
|
||||||
: temp-file ( name -- path ) temp-directory prepend-path ;
|
: temp-file ( name -- path ) temp-directory prepend-path ;
|
||||||
|
|
||||||
|
M: object normalize-pathname ( path -- path' )
|
||||||
|
current-directory get prepend-path ;
|
||||||
|
|
||||||
! Pathname presentations
|
! Pathname presentations
|
||||||
TUPLE: pathname string ;
|
TUPLE: pathname string ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue