1. Existence
- Posted by Robsz2 at aol.com
Mar 29, 2002
--part1_3f.90c8408.29d69088_boundary
Hello.
A quick question:
How do I check the existence of a file?
--part1_3f.90c8408.29d69088_boundary
<HTML><FONT FACE=arial,helvetica><FONT SIZE=2>Hello.
<BR>
<BR> A quick question:
<BR>
--part1_3f.90c8408.29d69088_boundary--
2. Re: Existence
On 29 Mar 2002, at 22:52, Robsz2 at aol.com wrote:
>
> --part1_3f.90c8408.29d69088_boundary
> Content-Type: text/html; charset="US-ASCII"
> Content-Transfer-Encoding: 7bit
>
> <HTML>
> <PRE>============ The Euphoria Mailing List ============
> </PRE>
>
> <FONT FACE=arial,helvetica><FONT SIZE=2>Hello.
> <BR>
> <BR> A quick question:
> <BR>
> <BR>
> How
> do I check the existence of a file?</FONT>
Either try to open it with open(), or read the directory with dir() to see if it
is
there. If it isn't there, open() will give an error. If it isn't there, dir()
won't list it.
Kat
3. Re: Existence
- Posted by akusaya at gmx.net
Mar 30, 2002
Try this function
global function filelen(sequence st)
object hasildir
hasildir = dir(st)
if atom(hasildir) or length(hasildir) = 0 then
return -1
end if
return hasildir[1][3]
end function
st is name of the file.
return -1 if file not exist
return 0 if file 0 bytes or opened for writing
return else = file size
R> Hello.
R> A quick question:
R> How do I check the existence of a file?