home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Spezial
/
SPEZIAL2_97.zip
/
SPEZIAL2_97.iso
/
ANWEND
/
ONLINE
/
SREFPRC1
/
GRABFIL1.SRF
< prev
next >
Wrap
Text File
|
1996-07-13
|
735b
|
28 lines
/*----------------------------------------------------------------------- */
/* GRAB_FILE read in a file, but first check to see if openable, and if
. openable, open and read it.
. Returns with the file, or with 0 if file not obtainable.
. Note that file is closed before returning.
. usage: afile_string=grab_file(the_file,seconds_to_try_for)
*/
/* ----------------------------------------------------------------------- */
sref_grab_file:
parse arg afile , msec
ause=sref_open_read(afile,msec)
if ause<0 then
return 0
goo=charin(afile,1,chars(afile))
ause=stream(afile,'c','close')
/* get rid of ending ctl-z */
if c2d(right(goo,1))=26 then
goo=left(goo,length(goo)-1)
return goo