[erlang-questions] file:pread/3

Matthias Lang matthias@REDACTED
Sun May 27 08:45:35 CEST 2007


Mike McNally writes:

 > Found my problem - apparently Locations like "{eof, -128}" don't work
 > for raw files (and I don't think that's noted, 

It _is_ noted. Here's the manual page for file:pread/3 straight from
erlang.org:

   pread(IoDevice, Location, Number) -> {ok, Data} | {error, Reason}
   
     Types:
   
       IoDevice = io_device()
       Location -- see position/2
       Number = int()
       Data = [char()] | binary() | eof
       Reason = posix()
   
   Combines position/2 and read/2 in one operation, which is more
   efficient than calling them one at a time. 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.

Matthias
   



More information about the erlang-questions mailing list