io: minor doc fixes throughout
parent
f3b264522c
commit
e5b30b7518
|
@ -24,7 +24,18 @@ HELP: file-system-info
|
||||||
{ $values
|
{ $values
|
||||||
{ "path" "a pathname string" }
|
{ "path" "a pathname string" }
|
||||||
{ "file-system-info" file-system-info } }
|
{ "file-system-info" file-system-info } }
|
||||||
{ $description "Returns a platform-specific object describing the file-system that contains the path. The cross-platform slot is " { $slot "free-space" } "." } ;
|
{ $description "Returns a platform-specific object describing the file-system that contains the path. The cross-platform slot is " { $slot "free-space" } "." }
|
||||||
|
{ $examples
|
||||||
|
{ $unchecked-example
|
||||||
|
"USING: io.files.info io.pathnames math prettyprint ;"
|
||||||
|
"IN: scratchpad"
|
||||||
|
""
|
||||||
|
": gb ( m -- n ) 30 2^ * ;"
|
||||||
|
""
|
||||||
|
"home file-system-info free-space>> 100 gb < ."
|
||||||
|
"f"
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
ARTICLE: "io.files.info" "File system meta-data"
|
ARTICLE: "io.files.info" "File system meta-data"
|
||||||
"File meta-data:"
|
"File meta-data:"
|
||||||
|
|
|
@ -44,7 +44,7 @@ HELP: with-mapped-array
|
||||||
{ $values
|
{ $values
|
||||||
{ "path" "a pathname string" } { "c-type" c-type } { "quot" quotation }
|
{ "path" "a pathname string" } { "c-type" c-type } { "quot" quotation }
|
||||||
}
|
}
|
||||||
{ $description "Memory-maps a file for reading and writing as a mapped-array of the given c-type. The mapped file is disposed of when the quotation returns, or if an error is thrown." }
|
{ $description "Memory-maps a file for reading and writing, wrapping it in a specialized array with the given element type. The mapped file is disposed of when the quotation returns, or if an error is thrown." }
|
||||||
{ $examples
|
{ $examples
|
||||||
{ $unchecked-example
|
{ $unchecked-example
|
||||||
"USING: alien.c-types io.mmap prettyprint specialized-arrays ;"
|
"USING: alien.c-types io.mmap prettyprint specialized-arrays ;"
|
||||||
|
@ -81,7 +81,7 @@ ARTICLE: "io.mmap.examples" "Memory-mapped file examples"
|
||||||
""
|
""
|
||||||
"\"mydata.dat\" char ["
|
"\"mydata.dat\" char ["
|
||||||
" 4 <sliced-groups>"
|
" 4 <sliced-groups>"
|
||||||
" [ reverse! drop ] map! drop"
|
" [ reverse! drop ] each"
|
||||||
"] with-mapped-array"
|
"] with-mapped-array"
|
||||||
}
|
}
|
||||||
"Normalize a file containing packed quadrupes of floats:"
|
"Normalize a file containing packed quadrupes of floats:"
|
||||||
|
|
|
@ -117,8 +117,9 @@ $nl
|
||||||
"An example which watches a directory for changes:"
|
"An example which watches a directory for changes:"
|
||||||
{ $code
|
{ $code
|
||||||
"USE: io.monitors"
|
"USE: io.monitors"
|
||||||
|
""
|
||||||
": watch-loop ( monitor -- )"
|
": watch-loop ( monitor -- )"
|
||||||
" dup next-change path>> print nl nl flush watch-loop ;"
|
" dup next-change path>> print flush watch-loop ;"
|
||||||
""
|
""
|
||||||
": watch-directory ( path -- )"
|
": watch-directory ( path -- )"
|
||||||
" [ t [ watch-loop ] with-monitor ] with-monitors ;"
|
" [ t [ watch-loop ] with-monitor ] with-monitors ;"
|
||||||
|
|
Loading…
Reference in New Issue