Fix usages of file-length
parent
753fa3824e
commit
a65c96042d
extra
|
@ -199,7 +199,7 @@ ARTICLE: "cookbook-io" "Input and output cookbook"
|
|||
}
|
||||
"Convert a file of 4-byte cells from little to big endian or vice versa, by directly mapping it into memory and operating on it with sequence words:"
|
||||
{ $code
|
||||
"\"mydata.dat\" dup file-length ["
|
||||
"\"mydata.dat\" dup file-info file-info-length ["
|
||||
" 4 <sliced-groups> [ reverse-here ] change-each"
|
||||
"] with-mapped-file"
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ IN: io.mmap.tests
|
|||
|
||||
[ "mmap-test-file.txt" resource-path delete-file ] ignore-errors
|
||||
[ ] [ "12345" "mmap-test-file.txt" resource-path ascii set-file-contents ] unit-test
|
||||
[ ] [ "mmap-test-file.txt" resource-path dup file-length [ CHAR: 2 0 pick set-nth drop ] with-mapped-file ] unit-test
|
||||
[ 5 ] [ "mmap-test-file.txt" resource-path dup file-length [ length ] with-mapped-file ] unit-test
|
||||
[ ] [ "mmap-test-file.txt" resource-path dup file-info file-info-length [ CHAR: 2 0 pick set-nth drop ] with-mapped-file ] unit-test
|
||||
[ 5 ] [ "mmap-test-file.txt" resource-path dup file-info file-info-length [ length ] with-mapped-file ] unit-test
|
||||
[ "22345" ] [ "mmap-test-file.txt" resource-path ascii file-contents ] unit-test
|
||||
[ "mmap-test-file.txt" resource-path delete-file ] ignore-errors
|
||||
|
|
|
@ -12,25 +12,25 @@ tools.deploy.backend math sequences io.launcher ;
|
|||
[ ] [ "hello-world" shake-and-bake ] unit-test
|
||||
|
||||
[ t ] [
|
||||
"hello.image" temp-file file-length 500000 <=
|
||||
"hello.image" temp-file file-info file-info-length 500000 <=
|
||||
] unit-test
|
||||
|
||||
[ ] [ "sudoku" shake-and-bake ] unit-test
|
||||
|
||||
[ t ] [
|
||||
"hello.image" temp-file file-length 1500000 <=
|
||||
"hello.image" temp-file file-info file-info-length 1500000 <=
|
||||
] unit-test
|
||||
|
||||
[ ] [ "hello-ui" shake-and-bake ] unit-test
|
||||
|
||||
[ t ] [
|
||||
"hello.image" temp-file file-length 2000000 <=
|
||||
"hello.image" temp-file file-info file-info-length 2000000 <=
|
||||
] unit-test
|
||||
|
||||
[ ] [ "bunny" shake-and-bake ] unit-test
|
||||
|
||||
[ t ] [
|
||||
"hello.image" temp-file file-length 3000000 <=
|
||||
"hello.image" temp-file file-info file-info-length 3000000 <=
|
||||
] unit-test
|
||||
|
||||
[ ] [
|
||||
|
|
Loading…
Reference in New Issue