<monitor> and mmaped-file use normalize-path now
parent
89ddc96b44
commit
b1016e6ea5
|
@ -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 ;
|
||||
|
|
|
@ -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 ;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue