unix: adding truncate-file.

db4
John Benediktsson 2012-10-25 21:51:08 -07:00
parent cff606f474
commit 7b50fd3601
2 changed files with 4 additions and 0 deletions

View File

@ -176,6 +176,8 @@ FUNCTION: int setuid ( uid_t uid ) ;
FUNCTION: int socket ( int domain, int type, int protocol ) ;
FUNCTION: int symlink ( c-string path1, c-string path2 ) ;
FUNCTION: int link ( c-string path1, c-string path2 ) ;
FUNCTION: int ftruncate ( int fd, int length ) ;
FUNCTION: int truncate ( c-string path, int length ) ;
FUNCTION: int unlink ( c-string path ) ;
FUNCTION: int utimes ( c-string path, timeval[2] times ) ;
FUNCTION: ssize_t write ( int fd, void* buf, size_t nbytes ) ;

View File

@ -56,6 +56,8 @@ M: unix open-file [ open ] unix-system-call ;
: make-fifo ( path mode -- ) [ mkfifo ] unix-system-call drop ;
: truncate-file ( path n -- ) [ truncate ] unix-system-call drop ;
: touch ( filename -- ) f [ utime ] unix-system-call drop ;
: change-file-times ( filename access modification -- )