Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!marlin.jcu.edu.au!cpawn From: cpawn@marlin.jcu.edu.au (Andrew W Nicholson) Newsgroups: comp.lang.pascal Subject: Check to see if file exists ???????? Message-ID: <1991May31.181401.7164@marlin.jcu.edu.au> Date: 31 May 91 18:14:01 GMT Sender: cpawn@marlin.jcu.edu.au (Andrew W Nicholson) Followup-To: cpawn@marlin.jcu.edu.au Organization: James Cook University of North Queensland Lines: 30 What I need to know is how to check if a filename input by the user exists. I have the following types and variables:- type string40 = array[1..40] of char; var in_file_name : string40; data_file : file of char; This is pascal on a Ultrix DEC station, not TP or any other fancy versions. After I prompt the user for the in_file_name and read it in, how do I check to see if the in_file_name given really exists? I need this because if the user enters an invalid in_file_name, the program bombs when I try to access it, which makes sense of course. Any ideas greatly accepted. Andrew. -- _--_|\,-----From Townsville in sunny North Queensland * / \ * * \_.--._/ Andrew Nicholson cpawn@marlin.jcu.edu.au ' v *