11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

names for the host operating system. On Windows and UNIX systems you can use the followingstandard pathname symbols: a single dot (.) to specify the current directory, or a doubledot (..) to specify its parent directory. For the directory functions on VMS, if name does notcontain the directory delimiters "[]" or "" it is assumed to be a subdirectory of the currentdirectory (i.e. "abc" is equivalent to "[.abc]"). For file deletion on VMS, an explicit file versionnumber must be supplied.Directory in $ZUTIL(140,13)$ZUTIL(140,13) uses the dir directory pathname to provide the name of the disk. It must,therefore contain the disk name, for example “c:”. dir can optionally supply a longer directorypathname, which is validated, but nothing beyond the disk name affects the values returned.If dir is a non-existent disk name or an invalid directory pathname, <strong>Caché</strong> returns -3. If diris a defined but unmounted disk, <strong>Caché</strong> returns -21. If dir is a file pathname, <strong>Caché</strong> returns-267. If dir contains a wildcard character (*), <strong>Caché</strong> returns -123.ExamplesThe following program example demonstrates the values returned by several of the$ZUTIL(140) flag options for a file:SET fname=$ZSEARCH("*cache.lck")WRITE !,"file path:",fnameWRITE !,"1:",$ZUTIL(140,1,fname)WRITE !,"2:",$ZUTIL(140,2,fname)WRITE !,"3:",$ZUTIL(140,3,fname)WRITE !,"4:",$ZUTIL(140,4,fname)WRITE !,"7:",$ZUTIL(140,7,fname)WRITE !,"12:",$ZUTIL(140,12,fname,0)The following program example demonstrates the values returned by $ZUTIL(140,13):SET dir="c:"SET by=" bytes",bl=" blocks"SET val=$ZUTIL(140,13,dir)WRITE !,"string is: ",valIF $PIECE(val,",",4)=1 {WRITE !,"This is a Windows system"WRITE !,$PIECE(val,",",1),by," free space available"WRITE !,$PIECE(val,",",2),by," total free space"WRITE !,$PIECE(val,",",3),by," total disk space"}ELSE { WRITE !,"This is a UNIX or VMS system"WRITE !,$PIECE(val,",",1),bl," free space available"WRITE !,$PIECE(val,",",2),bl," total free space"WRITE !,$PIECE(val,",",3),bl," total disk space"WRITE !,$PIECE(val,",",4),by," is the block size"}See Also• $ZSEARCH function$ZUTIL(140)<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 711

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!