is it possible to read and write from/to file using only 1 assign()?
I mean something like:
assign(fl, 'file.txt');
reset(fl)
// I know, that when I use reset - I have only read permission,
// but is there any other option to read and write opening the file only once?
read(fl, variable);
write(fl, 'asdf);
close(fl);
Resetdoes not give you only read access; the default is read/write (FileMode = 2), at least in Delphi’s Pascal, and FP is pretty compatible with it.From the help topic on
FileMode(emphasis mine):