]> gitweb.factorcode.org Git - factor.git/commitdiff
add make-hard-link to io.files.links
authorDoug Coleman <erg@jobim.local>
Wed, 29 Apr 2009 03:51:35 +0000 (22:51 -0500)
committerDoug Coleman <erg@jobim.local>
Wed, 29 Apr 2009 03:51:35 +0000 (22:51 -0500)
basis/io/files/links/links-docs.factor
basis/io/files/links/links.factor
basis/io/files/links/unix/unix.factor
basis/unix/unix.factor

index 8419399c92fdd314f4efe2bd9ae2c84e9cf5a57c..bf1bedaa08c342fac92c00246b5e2e1f64d1ff62 100644 (file)
@@ -5,6 +5,10 @@ HELP: make-link
 { $values { "target" "a path to the symbolic link's target" } { "symlink" "a path to new symbolic link" } }
 { $description "Creates a symbolic link." } ;
 
+HELP: make-hard-link
+{ $values { "target" "a path to the hard link's target" } { "link" "a path to new symbolic link" } }
+{ $description "Creates a hard link." } ;
+
 HELP: read-link
 { $values { "symlink" "a path to an existing symbolic link" } { "path" "the path pointed to by the symbolic link" } }
 { $description "Reads the symbolic link and returns its target path." } ;
index 1212d579dbe13234e11a2b107355dda5f8fd5982..7aec916c72086977809a0e4f6a8a6e97acdd62bf 100644 (file)
@@ -6,6 +6,8 @@ IN: io.files.links
 
 HOOK: make-link os ( target symlink -- )
 
+HOOK: make-hard-link os ( target link -- )
+
 HOOK: read-link os ( symlink -- path )
 
 : copy-link ( target symlink -- )
index 7d2a6ee4f3c31b474388fc6f78589a39e2850ece..c9a651b4844cfa5a004b1bdb4fa927b2651654c9 100644 (file)
@@ -7,6 +7,9 @@ IN: io.files.links.unix
 M: unix make-link ( path1 path2 -- )
     normalize-path symlink io-error ;
 
+M: unix make-hard-link ( path1 path2 -- )
+    normalize-path link io-error ;
+
 M: unix read-link ( path -- path' )
     normalize-path read-symbolic-link ;
 
index a6a0147504240944bfaed396df148cf0c0ee5133..10fb2ad64fbf9fc8ca5ffc40e13ee3f85df8fc88 100644 (file)
@@ -194,6 +194,7 @@ FUNCTION: int setsockopt ( int s, int level, int optname, void* optval, socklen_
 FUNCTION: int setuid ( uid_t uid ) ;
 FUNCTION: int socket ( int domain, int type, int protocol ) ;
 FUNCTION: int symlink ( char* path1, char* path2 ) ;
+FUNCTION: int link ( char* path1, char* path2 ) ;
 FUNCTION: int system ( char* command ) ;
 
 FUNCTION: int unlink ( char* path ) ;