高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】file write issue
file write issue
file write issue
does dwgdirect expect a buffered read and write??
in my odstreambuf derived class, the very first call received is a "seek" call..
since the file is 0 bytes, my seek call naturally fails..this happens only when writing to version = vac15 and not for vac18(for vac18, the file size is always greater than the seek call's offset).
seeing the implementation in odfilebuf.cpp, i assume that buffered read/write is expected. if so, what is the maximum buffer size that dwgdirect expects ??
thanks
alex
last edited by alex30; 20th september 2005 at 01:33 pmfff">.
the documentation is insufficient for me to answer this..
plz provide some pointers for this too.
tia
alex
dwgdirect does not expect a buffered stream to read/write.
at the moment dwgdirect uses seek() with the file-position beyond the end of a file while writing dwg vac13..vac15 to reserve space for the file header data (first 81 bytes).
many implementations of seek functionality (e.g. fseek() at most of platforms) support seeking beyond the end of a file while writing (when you next write to the file, it gets extended, creating a hole in the file).
but such behavior depends on implementation and we will remove seeking beyond the end of a file at the next release.
regards,
sergey vishnevetsky
quote:
originally posted by sergey vishnevetsky
but such behavior depends on implementation and we will remove seeking beyond the end of a file at the next release.
has the seek beyond the end of file been removed? i can optimize my implementation a lot if i don't need to check for this.
also it would be most helpful if i could know for sure whether or not iseof() ever called during the writefile() operation. i haven't encountered the call to this during export of either dwg or dxf so far in my tests, but i would like to confirm the same. thanks.
regards,
varun
last edited by varunsnair; 22nd november 2006 at 12:54 amfff">.
the seek beyond the end of file is removed since dd1.14 version.
regards,
sergey vishnevetsky
|