Minor documentation updates

db4
Slava Pestov 2008-06-27 21:51:42 -05:00
parent 9140679e9f
commit 5ddaeccf21
7 changed files with 53 additions and 37 deletions

View File

@ -88,6 +88,7 @@ $nl
$nl
"The basic building blocks:"
{ $subsection "threads" }
{ $subsection "alarms" }
"High-level abstractions:"
{ $subsection "concurrency.combinators" }
{ $subsection "concurrency.promises" }
@ -274,6 +275,7 @@ ARTICLE: "handbook" "Factor documentation"
{ $heading "Library reference" }
{ $subsection "numbers" }
{ $subsection "collections" }
{ $subsection "models" }
{ $subsection "io" }
{ $subsection "concurrency" }
{ $subsection "system" }
@ -288,8 +290,8 @@ ARTICLE: "handbook" "Factor documentation"
{ $subsection "compiler" }
{ $subsection "layouts" }
{ $heading "User interface" }
{ $about "ui" }
{ $about "ui.tools" }
{ $subsection "ui" }
{ $subsection "ui-tools" }
{ $heading "Index" }
{ $subsection "primitive-index" }
{ $subsection "error-index" }

View File

@ -55,23 +55,31 @@ ARTICLE: "io.monitors.descriptors" "File system change descriptors"
{ $subsection +rename-file+ } ;
ARTICLE: "io.monitors.platforms" "Monitors on different platforms"
"Whether the " { $snippet "path" } " output value of " { $link next-change } " contains an absolute path or a path relative to the path given to " { $link <monitor> } " is platform-specific. User code should not assume either case."
"Whether the " { $snippet "path" } " output value of " { $link next-change } " contains an absolute path or a path relative to the path given to " { $link <monitor> } " is unspecified, and may even vary on the same platform. User code should not assume either case."
$nl
"If the immediate path being monitored was changed, then " { $snippet "path" } " will equal " { $snippet "\"\"" } "; however this condition is not reported on all platforms. See below."
{ $heading "Mac OS X" }
"Factor uses " { $snippet "FSEventStream" } "s to implement monitors on Mac OS X. This requires Mac OS X 10.5 or later."
$nl
{ $snippet "FSEventStream" } "s always monitor directory hierarchies recursively, and the " { $snippet "recursive?" } " parameter to " { $link <monitor> } " has no effect."
$nl
"The " { $snippet "changed" } " output value of the " { $link next-change } " word always outputs " { $link +modify-file+ } " and the " { $snippet "path" } " output value is always the directory containing the file that changed. Unlike other platforms, fine-grained information is not available."
$nl
"Only directories may be monitored, not individual files. Changes to the directory itself (permissions, modification time, and so on) are not reported; only changes to children are reported."
{ $heading "Windows" }
"Factor uses " { $snippet "ReadDirectoryChanges" } " to implement monitors on Windows."
$nl
"Both recursive and non-recursive monitors are directly supported by the operating system."
$nl
"Only directories may be monitored, not individual files. Changes to the directory itself (permissions, modification time, and so on) are not reported; only changes to children are reported."
{ $heading "Linux" }
"Factor uses " { $snippet "inotify" } " to implement monitors on Linux. This requires Linux kernel version 2.6.16 or later."
$nl
"Factor simulates recursive monitors by creating a hierarchy of monitors for every subdirectory, since " { $snippet "inotify" } " can only monitor a single directory. This is transparent to user code."
$nl
"Inside a single " { $link with-monitors } " scope, only one monitor may be created for any given directory."
$nl
"Both directories and files may be monitored. Unlike Mac OS X and Windows, changes to the immediate directory being monitored (permissions, modification time, and so on) are reported."
{ $heading "BSD" }
"Factor uses " { $snippet "kqueue" } " to implement monitors on BSD."
$nl

View File

@ -108,34 +108,4 @@ os { winnt linux macosx } member? [
[ [ t ] [ "m" get next-change 2drop ] [ ] while ] must-fail
[ ] [ "m" get dispose ] unit-test
] with-monitors
! On Linux, a notification on the directory itself would report an invalid
! path name
[
[ ] [ "monitor-test-self" temp-file make-directories ] unit-test
! Non-recursive
[ ] [ "monitor-test-self" temp-file f <monitor> "m" set ] unit-test
[ ] [ "monitor-test-self" temp-file touch-file ] unit-test
[ t ] [
"m" get next-change drop
[ "." = ] [ "monitor-test-self" temp-file = ] bi or
] unit-test
[ ] [ "m" get dispose ] unit-test
! Recursive
[ ] [ "monitor-test-self" temp-file t <monitor> "m" set ] unit-test
[ ] [ "monitor-test-self" temp-file touch-file ] unit-test
[ t ] [
"m" get next-change drop
[ "." = ] [ "monitor-test-self" temp-file = ] bi or
] unit-test
[ ] [ "m" get dispose ] unit-test
] with-monitors
] when

View File

@ -0,0 +1,34 @@
IN: io.unix.linux.monitors.tests
USING: io.monitors tools.test io.files system sequences
continuations namespaces concurrency.count-downs kernel io
threads calendar prettyprint destructors io.timeouts ;
! On Linux, a notification on the directory itself would report an invalid
! path name
[
[ ] [ "monitor-test-self" temp-file make-directories ] unit-test
! Non-recursive
[ ] [ "monitor-test-self" temp-file f <monitor> "m" set ] unit-test
[ ] [ "monitor-test-self" temp-file touch-file ] unit-test
[ t ] [
"m" get next-change drop
[ "." = ] [ "monitor-test-self" temp-file = ] bi or
] unit-test
[ ] [ "m" get dispose ] unit-test
! Recursive
[ ] [ "monitor-test-self" temp-file t <monitor> "m" set ] unit-test
[ ] [ "monitor-test-self" temp-file touch-file ] unit-test
[ t ] [
"m" get next-change drop
[ "" = ] [ "monitor-test-self" temp-file = ] bi or
] unit-test
[ ] [ "m" get dispose ] unit-test
] with-monitors

View File

@ -85,7 +85,7 @@ M: linux-monitor dispose* ( monitor -- )
: parse-event-name ( event -- name )
dup inotify-event-len zero?
[ drop "." ] [ inotify-event-name utf8 alien>string ] if ;
[ drop "" ] [ inotify-event-name utf8 alien>string ] if ;
: parse-file-notify ( buffer -- path changed )
dup inotify-event-mask ignore-flags? [

View File

@ -232,8 +232,10 @@ HELP: move-by-page
{ $side-effects "range" } ;
ARTICLE: "models" "Models"
"The Factor UI provides basic support for dataflow programming via " { $emphasis "models" } " and " { $emphasis "controls" } ". A model is an observable value. Changing a model's value notifies other objects which depend on the model automatically, and models may depend on each other's values."
"The " { $vocab-link "models" } " vocabulary provides basic support for dataflow programming. A model is an observable value. Changing a model's value notifies other objects which depend on the model automatically, and models may depend on each other's values."
$nl
"The class of models:"
{ $subsection model }
"Creating models:"
{ $subsection <model> }
"Adding and removing connections:"

View File

@ -89,8 +89,8 @@ ARTICLE: "building-ui" "Building user interfaces"
{ $subsection "ui-geometry" }
{ $subsection "ui-layouts" }
{ $subsection "gadgets" }
{ $subsection "models" }
{ $subsection "ui-windows" } ;
{ $subsection "ui-windows" }
{ $see-also "models" } ;
ARTICLE: "gadgets" "Pre-made UI gadgets"
{ $subsection "ui.gadgets.labels" }