io: minor doc fixes throughout
parent
f3b264522c
commit
e5b30b7518
|
@ -24,7 +24,18 @@ HELP: file-system-info
|
|||
{ $values
|
||||
{ "path" "a pathname string" }
|
||||
{ "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"
|
||||
"File meta-data:"
|
||||
|
|
|
@ -44,7 +44,7 @@ HELP: with-mapped-array
|
|||
{ $values
|
||||
{ "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
|
||||
{ $unchecked-example
|
||||
"USING: alien.c-types io.mmap prettyprint specialized-arrays ;"
|
||||
|
@ -81,7 +81,7 @@ ARTICLE: "io.mmap.examples" "Memory-mapped file examples"
|
|||
""
|
||||
"\"mydata.dat\" char ["
|
||||
" 4 <sliced-groups>"
|
||||
" [ reverse! drop ] map! drop"
|
||||
" [ reverse! drop ] each"
|
||||
"] with-mapped-array"
|
||||
}
|
||||
"Normalize a file containing packed quadrupes of floats:"
|
||||
|
|
|
@ -117,8 +117,9 @@ $nl
|
|||
"An example which watches a directory for changes:"
|
||||
{ $code
|
||||
"USE: io.monitors"
|
||||
""
|
||||
": watch-loop ( monitor -- )"
|
||||
" dup next-change path>> print nl nl flush watch-loop ;"
|
||||
" dup next-change path>> print flush watch-loop ;"
|
||||
""
|
||||
": watch-directory ( path -- )"
|
||||
" [ t [ watch-loop ] with-monitor ] with-monitors ;"
|
||||
|
|
Loading…
Reference in New Issue