1MONGOC_GRIDFS_FILE_SEEK(3) libmongoc MONGOC_GRIDFS_FILE_SEEK(3)
2
3
4
6 mongoc_gridfs_file_seek - mongoc_gridfs_file_seek()
7
9 int
10 mongoc_gridfs_file_seek (mongoc_gridfs_file_t *file, int64_t delta, int whence);
11
13 · file: A mongoc_gridfs_file_t.
14
15 · delta: The amount to move the file position. May be positive or nega‐
16 tive.
17
18 · whence: One of SEEK_SET, SEEK_CUR or SEEK_END.
19
21 Adjust the file position pointer in the given file by delta, starting
22 from the position whence. The whence argument is interpreted as in
23 fseek(2):
24
25 ┌─────────┬────────────────────────────┐
26 │SEEK_SET │ Set the position relative │
27 │ │ to the start of the file. │
28 ├─────────┼────────────────────────────┤
29 │SEEK_CUR │ Move delta relative to the │
30 │ │ current file position. │
31 ├─────────┼────────────────────────────┤
32 │SEEK_END │ Move delta relative to the │
33 │ │ end of the file. │
34 └─────────┴────────────────────────────┘
35
36 On success, the file's underlying position pointer is set appropri‐
37 ately. On failure, the file position is NOT changed and errno is set to
38 indicate the error.
39
41 ┌───────┬────────────────────────────┐
42 │EINVAL │ whence is not one of │
43 │ │ SEEK_SET, SEEK_CUR or │
44 │ │ SEEK_END. │
45 ├───────┼────────────────────────────┤
46 │EINVAL │ The resulting file posi‐ │
47 │ │ tion would be negative. │
48 └───────┴────────────────────────────┘
49
51 Returns 0 if successful; otherwise -1 and errno is set.
52
54 MongoDB, Inc
55
57 2017-present, MongoDB, Inc
58
59
60
61
621.17.4 Feb 04, 2021 MONGOC_GRIDFS_FILE_SEEK(3)