Re: Doubts about appending data to a file
- From: dpb <none@xxxxxxx>
- Date: Mon, 22 Oct 2007 08:44:57 -0500
deltaquattro wrote:
....
open(99,file=filename,action='write',position='append')....
I used the optional specifier "position" because maybe the file
filename has been already created by another call to displaymsg.
However, I was taught never to open a file without specifying the
"status" specifier, i.e. with status='unknown', because this could
lead to unpredictable results. Is it better to add an "inquire"
statement before "open", in order to determine the status of
filename, or is it redundant? ...
STATUS specifier...
'UNKNOWN' Indicates the file may or may not exist. If the file does not exist, a new file is created and its status changes to 'OLD'.
.... The default is 'UNKNOWN'.
While adding it would make the code more clear to read in the future, functionally it will make no difference.
My choice would be to add it for the above reason, although I've certainly been known to write code that doesn't... :)
--
.
- References:
- Doubts about appending data to a file
- From: deltaquattro
- Doubts about appending data to a file
- Prev by Date: Re: Full list all "uninitialized" variables when compile
- Next by Date: Re: Doubts about appending data to a file
- Previous by thread: Doubts about appending data to a file
- Next by thread: Re: Doubts about appending data to a file
- Index(es):
Relevant Pages
|