File:  [Coherent Logic Development] / freem / contrib / %FUTIL.m
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Jan 19 02:04:04 2025 UTC (6 months, 1 week ago) by snw
Branches: MAIN, CoherentLogicDevelopment
CVS tags: v0-63-1-rc1, v0-63-0-rc1, v0-63-0, v0-62-3, v0-62-2, v0-62-1, v0-62-0, start, HEAD
FreeM

    1: %FUTIL	; A.Trocha ; File i/o Library[1999/02/01-20:20:05]
    2: 	; $Source: /home/cvsroot/freem/contrib/%FUTIL.m,v $
    3: 	; $Revision: 1.1.1.1 $ $Date: 2025/01/19 02:04:04 $
    4: 	Q
    5: 	;
    6: 	;
    7: direx(path) ;--- test if directory exists
    8: 	;        0 = does not exist     1 = success
    9: 	;
   10: 	S $ZT="direx99^"_$ZN
   11: 	N tmp
   12: 	S tmp=$V(2)
   13: 	V 2:path
   14: 	V 2:tmp
   15: 	Q 1
   16: 	Q
   17: direx99	;--- error
   18: 	Q 0
   19: 	;
   20: 	;
   21: mkdir(path) ;--- create directory
   22: 	;        0 = error      1 = ok
   23: 	;
   24: 	N exec
   25: 	S exec="!mkdir "_path_">/dev/null"
   26: 	X exec
   27: 	Q $$direx(path)
   28: 	;
   29: 	;
   30: rmdir(path) ;--- delete directory   "rm -r"
   31: 	; **** take care ****
   32: 	N exec
   33: 	S exec="!rm -r "_path_">/dev/null"
   34: 	X exec
   35: 	Q '$$direx(path)

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