use HOMEDRIVE/HOMEPATH for HOME, then USERPROFILE, the default to a directory if no env vars are set

db4
Doug Coleman 2009-04-20 21:11:50 -05:00
parent be2639c168
commit 08d80f6237
1 changed files with 7 additions and 2 deletions

View File

@ -4,7 +4,7 @@ io.backend.windows io.files.windows io.encodings.utf16n windows
windows.kernel32 kernel libc math threads system environment
alien.c-types alien.arrays alien.strings sequences combinators
combinators.short-circuit ascii splitting alien strings assocs
namespaces make accessors tr windows.time ;
namespaces make accessors tr windows.time windows.shell32 ;
IN: io.files.windows.nt
M: winnt cwd
@ -58,4 +58,9 @@ M: winnt open-append
[ dup windows-file-size ] [ drop 0 ] recover
[ (open-append) ] dip >>ptr ;
M: winnt home "USERPROFILE" os-env ;
M: winnt home
{
[ "HOMEDRIVE" os-env "HOMEPATH" os-env append-path ]
[ "USERPROFILE" os-env ]
[ my-documents ]
} 0|| ;