Re: Doubts about appending data to a file



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... :)

--
.



Relevant Pages

  • Re: WME 9.1 x64 output file create/naming errors
    ... I'm specifying the input filename as a full file/path name, ... that the first file created in each output folder by WME is ... I can't rule out this is a potential bug in the 64 bit encoder, ...
    (microsoft.public.windowsmedia.encoder)
  • Re: need help with exporting figures into jpgs
    ... Problem reading Figure handle in -f switch: ... You can print a noncurrent figure by specifying the figure's handle. ... This example uses the function form of print to enable a file name to ... print('-f3', '-dpsc', filename); ...
    (comp.soft-sys.matlab)
  • Re: Creating file with long filename
    ... > I'm trying to create a file with long filename, ... > mov ax,716Ch ... Pointer to a null-terminated string specifying the name of the file to be opened or created. ... Number that is used in the numeric tail for the alias. ...
    (comp.lang.asm.x86)
  • Re: is something wrong in it?
    ... Specifying a path to the executable (e.g. by prefixing ./ to the filename when it exists in the current directory) tells the shell exactly where to find it, so it doesn't bother looking in $PATH. ... it stops working when you open Windows. ...
    (comp.os.linux.misc)
  • Re: Lego?
    ... they never use the phrase "out of LEGO" without specifying ... Persumably their trademark lawyers were taught the nonsense legal ... maxim "trademarks can only be adjectives". ...
    (alt.usage.english)