Diff for /gforth/mkdir.fs between versions 1.4 and 1.8

version 1.4, 2008/10/06 21:21:20 version 1.8, 2012/03/13 19:33:31
Line 1 Line 1
 \ mkdir wrapper  \ mkdir wrapper
   
 \ Copyright (C) 2008 Free Software Foundation, Inc.  \ Copyright (C) 2008,2010 Free Software Foundation, Inc.
   
 \ This file is part of Gforth.  \ This file is part of Gforth.
   
Line 18 Line 18
 \ along with this program. If not, see http://www.gnu.org/licenses/.  \ along with this program. If not, see http://www.gnu.org/licenses/.
   
 \ there is now a primitive =MKDIR  \ there is now a primitive =MKDIR
 \ require cstr.fs  [IFUNDEF] =mkdir
 \ c-library mkdir      [IFUNDEF] c-library
 \ \c #include <sys/stat.h>          \ define dummy mkdir
 \ \c #include <sys/types.h>          : =mkdir ( c-addr u mode -- ior )
 \ c-function mkdir mkdir a n -- n ( pathname\0 mode -- f )              2drop drop 0 ;
 \ \c #include <errno.h>      [ELSE]
 \ \c #define IOR(flag)  ((flag)? -512-errno : 0)          require cstr.fs
 \ c-function f>ior IOR n -- n ( f -- ior )          c-library mkdir
           \c #include <sys/stat.h>
 \ : =mkdir ( c-addr u mode -- ior )          \c #include <sys/types.h>
 \     >r 1 tilde_cstr r> mkdir f>ior ;          c-function mkdir mkdir a n -- n ( pathname\0 mode -- f )
 \ end-c-library          \c #include <errno.h>
           \c #define IOR(flag)    ((flag)? -512-errno : 0)
           c-function f>ior IOR n -- n ( f -- ior )
               
           : =mkdir ( c-addr u mode -- ior )
           >r 1 tilde_cstr r> over >r mkdir r> free drop f>ior ;
           end-c-library
       [THEN]
   [THEN]
   
 : mkdir-parents { c-addr u mode -- ior }  : mkdir-parents { c-addr u mode -- ior }
     \G create the directory @i{c-addr u} and all its parents with      \G create the directory @i{c-addr u} and all its parents with
Line 40 Line 48
     repeat      repeat
     drop 2drop      drop 2drop
     c-addr u mode =mkdir ;      c-addr u mode =mkdir ;
   
           
   

Removed from v.1.4  
changed lines
  Added in v.1.8


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>