<monitor> and mmaped-file use normalize-path now

db4
Doug Coleman 2008-04-24 19:46:52 -05:00
parent 89ddc96b44
commit b1016e6ea5
3 changed files with 4 additions and 3 deletions

View File

@ -39,7 +39,7 @@ M: monitor set-timeout (>>timeout) ;
HOOK: (monitor) io-backend ( path recursive? mailbox -- monitor )
: <monitor> ( path recursive? -- monitor )
<mailbox> (monitor) ;
>r normalize-path r> <mailbox> (monitor) ;
: next-change ( monitor -- path changed )
[ queue>> ] [ timeout ] bi mailbox-get-timeout first2 ;

View File

@ -1,7 +1,7 @@
! Copyright (C) 2007 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: alien io io.files kernel math system unix io.unix.backend
io.mmap ;
io.mmap io.backend ;
IN: io.unix.mmap
: open-r/w ( path -- fd ) O_RDWR file-mode open dup io-error ;
@ -11,7 +11,7 @@ IN: io.unix.mmap
over MAP_FAILED = [ close (io-error) ] when ;
M: unix <mapped-file> ( path length -- obj )
swap >r
swap normalize-path >r
dup PROT_READ PROT_WRITE bitor MAP_FILE MAP_SHARED bitor
r> mmap-open f mapped-file boa ;

View File

@ -61,6 +61,7 @@ M: wince with-privileges
nip call ;
: mmap-open ( path access-mode create-mode flProtect access -- handle handle address )
>r >r >r >r normalize-path r> r> r> r>
{ "SeCreateGlobalPrivilege" "SeLockMemoryPrivilege" } [
>r >r 0 open-file dup f r> 0 0 f
CreateFileMapping [ win32-error=0/f ] keep