[erlang-questions] Location options in file:pread/2 and /3

Bjorn Gustavsson <>
Wed May 7 10:15:11 CEST 2008


Zvi <> writes:

> Are all these options are still supported in file:pread/2 and file:pread/3 ?
> >From my tests, only file:position accepts them. file:pread/2 and /3 only
> accepts Offset and giving {error,badarg} for the rest.

They are accepted if the file has not been opened in raw mode.
There is a note about that in the documentation for pread/3:

"If IoDevice has been opened in raw mode, some restrictions apply: Location is only allowed to be an integer; and the current position of the file is undefined after the operation."

/Bjorn
-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list