# Retrieval locks

If a BASIC program is run by a user that does not have
retrieval or update privileges (for a file that does and is opened
in the program), and then attempts to read and/or write to that file,
the program terminates with an error message. In order to read or
write to such a file, users must make sure that the retrieval and
update lock codes match those of the file that is opened. This is
a system function and cannot be accomplished from BASIC. If the file
is retrieval protected, the file cannot be opened and the program
is terminated with an error message.

## See also

- [Retrieval and update locks](https://d3codex.com/definitions/retrieval-and-update-locks/)

---
Source: https://d3codex.com/pickbasic-flashbasic/retrieval-locks/ - part of the D3Codex reference.
