How to check the FILE HANDLE STATUS ???

2004-09-24 Thread Madhu Reddy
hi, I want to check the status of File handle before reading/writing to file ? How to do this ? like following open(FH_IN_FILE, file.txt); # This statement is executed by some other function close(FH_IN_FILE); print FH_IN_FILE SOME DATA; here before writing to file, i want to check the

Re: How to check the FILE HANDLE STATUS ???

2004-09-24 Thread Wiggins d Anconia
hi, I want to check the status of File handle before reading/writing to file ? How to do this ? like following open(FH_IN_FILE, file.txt); Which itself is a bad idea, always check that the open succeeded in the first place, open FH_IN_FILE, file.txt or die Can't open file for

Re: How to check the FILE HANDLE STATUS ???

2004-09-24 Thread Dave Gray
open(FH_IN_FILE, file.txt); # This statement is executed by some other function close(FH_IN_FILE); print FH_IN_FILE SOME DATA; here before writing to file, i want to check the status of FH_IN_FILE..(whether file is opened or closed ) You could do something like the following: -

Re: How to check the FILE HANDLE STATUS ???

2004-09-24 Thread John W. Krahn
Madhu Reddy wrote: hi, Hello, I want to check the status of File handle before reading/writing to file ? How to do this ? like following open(FH_IN_FILE, file.txt); # This statement is executed by some other function close(FH_IN_FILE); print FH_IN_FILE SOME DATA; here before writing to file,