Hello,

I'm trying to use the File Streaming API to determine whether
a file exists, and if so, what its size is.  I am doing this so I
can decide whether to create/overwrite a file.

I have tried several methods, and all give disturbing error
messages in POSE.

1. 
lLen = sizeof ( Boolean );
fErr = FileControl( fileOpGetCreatedStatus, fStream,
  &bValue, &lLen );
if (bValue) . . .
    then supposedly the file was just created.  But POSE
    gives this message:

        "...has just read directly from an unallocated chunk
         of memory."

2.
fStream = FileOpen( 0, PROGRAM_INI_FILE, 0, 0,
      (fileModeReadOnly | fileModeExclusive), &fErr );
if (! fStream)  return fErr;
fErr = FileSeek( fStream, 1, fileOriginBeginning );

If fErr is set to fileErrEOF, then the file is has no bytes, and
can be safely overwritten.

But again, POSE says that my program:

        "...has just read directly from an unallocated chunk
         of memory."

3.
fStream = FileOpen( 0, PROGRAM_INI_FILE, 0, 0,
      (fileModeReadOnly | fileModeExclusive), &fErr );
if (! fStream)  return fErr;
fErr = FileEOF( fStream );

Again, the same message from POSE.

Please tell me what is the best method for determining
file existence and size.  Something like the Unix stat()
function would be ideal.

Thanks,

Greg Bungo
[EMAIL PROTECTED]
(630)949-3250  voice
(630)949-3299  fax





Reply via email to