home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Acorn User 11
/
AUCD11B.iso
/
LANGUAGES
/
WraithSet
/
AwkStuff
/
GawkSrc
/
Docs
/
Riscos
< prev
Wrap
Text File
|
1999-11-06
|
1KB
|
39 lines
****** Extra builtin functions for RISC OS version ********
sysvar(s)
returns the string value of the system variable s, and causes
an error if the variable is undefined.
filetype(f)
returns the numeric value of the filetype of file f.
It returns -1 if the file does not exist or has no type.
It returns 0x1000 if f is a directory, and
0x2000 if it is an application.
This function cannot be used on a file that is open.
So for example
function filetypestring(f, type) {
if ((type = exists(f)) == 0) return ""
if (type == 2) return "directory"
if (type == 3) return "image file"
return sysvar("File$Type_" sprintf("%3x",filetype(f))) }
gives the filetype as a string, if defined.
exists(f)
returns 0 if f does not exist
1 if f is a file
2 if f is a directory
3 if f is an image file
This function cannot be used on a file that is open.
later(f1,f2)
returns 1 if the datestamp of file f1 is later than
that of f2 and 0 otherwise.
-------------------------------------------------------------------
G.C.Wraith 15/9/99
mailto:gavin@wraith.u-net.com
http://www.wraith.u-net.com