One can seek past the end of a GridFS file and proceed to write:
mongoc_gridfs_file_seek (file, 1024 * 32, SEEK_END) mongoc_gridfs_file_writev (file, iov, iovcnt, timeout_msec);
However, performing a mongoc_gridfs_file_readv() in the "gap space" will likely end in a crash. The C Driver needs to decide how it wants to handle this, consistent with the GridFS spec. Perhaps a reasonable approach is to:
1. Seek past the end of the file.
2. On performing any I/O operation, fill in the missing chunks with zero bytes, similar to the behavior of fseek(2) and writev(2).
- is duplicated by
-
CDRIVER-870 Handle GridFS I/O operations beyond end-of-file
- Closed
- related to
-
CDRIVER-870 Handle GridFS I/O operations beyond end-of-file
- Closed