--=.sWV2J_SZFTc7se
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Tue, 18 Mar 2003 01:26:40 +0900
Friedrich Dominicus <frido / q-software-solutions.com> wrote:
> Just a poor example. Checking if a file exists. This is not a place
> for Exceptions but for testing of existance and take appropriate
> action than. So no Pseudo Code
> try open_file
> except ... do what it takes while file is not there but
> 
> if file.exists? (file_name) ...
> else
> do something about it.

While this is how I tend to do things, doesn't this leave you open for
a race condition?
e.g.
if File.exists?
		<< DELETE FILE HERE
	File.open
		<< EXCEPTION, file not found

so you would still have to check for exceptions anyway to be safe.


-- 
Stephen Lewis
slewis / paradise.net.nz

--=.sWV2J_SZFTc7se
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+djwHIgTEtLC7U/IRAiWbAJ9Eusc3Oc6FukUzZbxWdhIHOFozygCfcfJ2
kQjF0RY0RpnPjBVHySRkoF8=
=JL4h
-----END PGP SIGNATURE-----

--=.sWV2J_SZFTc7se--