Vely logo install

Vely 15.2.0 released on Jan 18, 2023
Articles updated Jan 17, 2023


Issues with this documentation page? Report here.


Set a position or get a current position for an open file.


file-position file-id <file id> \
    ( set <position> ) | ( get [ define ] <position> ) \
    [ status [ define ] <status> ]


file-position will set or get position for a file opened with open-file, where <file id> is an open file identifier.

If "set" clause is used, file position is set to <position>.

If "get" clause is used, file position is obtained in <position>, which can be created with optional "define".

The optional <status> in "status" clause will be VV_OKAY if set/get succeeded, or VV_ERR_POSITION if not. <status> can be created with optional "define".

Note that setting position past the last byte of file is okay for writing - in this case the bytes between the end of file and the <position> are filled with null-bytes when the write operation occurs.


Open file "testwrite" and set file byte position to 100, then obtain it later:

open-file "testwrite" file-id define nf
file-position file-id nf set 100
file-position file-id nf get define pos

See also open-file.

See also:

Files ( close-file   copy-file   delete-file   file-position   file_storage   file_uploading   lock-file   open-file   read-file   read-line   rename-file   stat-file   temporary_file   uniq-file   unlock-file   write-file  )  SEE ALL (documentation)

Copyright (c) 2022 DaSoftver LLC. Vely is a trademark of Dasoftver LLC. The software and information herein are provided "AS IS" and without any warranties or guarantees of any kind. Vely elephant logo (c) 2022 DaSoftver LLC. This web page is licensed under CC-BY-SA-4.0.