AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

1999.09.14 15:29 "TIFFOpen in tif_win32.c", by Christopher Lawton

Hi all,

In my attempt to get libtiff.a working on the Windows platform, I ran across a possible problem with TIFFOpen in tif_win32.c. If you call TIFFOpen with the mode equal to 'a' (append), it fails if the file already exists.

tif = TIFFOpen(filename, "a")

CreateFile returns an invalid file handle. If you use GetLastError the error code returned is number 80 "The file exists". The problem appears to be that dwMode is set to CREATE_NEW (line 179 tif_win32.c). To achieve the expected behavior I think it should be set to OPEN_ALWAYS.

Is this a known problem?

Thanks,

Chris Lawton

clawton@mathworks.com