]> gitweb.factorcode.org Git - factor.git/blob - basis/io/files/links/unix/unix.factor
Make unix-system-call retry the call immediately upon hitting EINTR. Use unix-system...
[factor.git] / basis / io / files / links / unix / unix.factor
1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: io.backend io.files.links system unix io.pathnames kernel
4 io.files sequences ;
5 IN: io.files.links.unix
6
7 M: unix make-link ( path1 path2 -- )
8     normalize-path [ symlink ] unix-system-call io-error ;
9
10 M: unix make-hard-link ( path1 path2 -- )
11     normalize-path [ link ] unix-system-call io-error ;
12
13 M: unix read-link ( path -- path' )
14     normalize-path read-symbolic-link ;
15
16 M: unix resolve-symlinks ( path -- path' )
17     path-components "/"
18     [ append-path dup exists? [ follow-links ] when ] reduce ;