On 06.01.2012 01:17, Barry Smith wrote: > On Jan 5, 2012, at 9:40 AM, Jed Brown wrote: > >> On Thu, Jan 5, 2012 at 09:36, Alexander Grayver<agrayver at gfz-potsdam.de> >> wrote: >> Maybe this should be noted in the documentation? >> >> Yes, I think the old file should be closed (if it exists), but I'll wait for >> comment. > I never thought about the case where someone called > PetscViewerFileSetName() twice. I'm surprised that it works at all. > > Yes, it should (IMHO) be changed to close the old file if used twice. > > Barry > > BTW: It is also possible to put many vectors and matrices in the same file > and read them in using several different ways using PetscBinaryRead(). I > (personally) think any approach that involves creating hundreds of files is > nuts.
This is not always convinient to store everything in one file, but in some cases I do want to use it. I haven't found any examples on that. Do I have to use FILE_MODE_APPEND and then write? What happens if file doesn't exist? Regards, Alexander
