You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original reporter: JIRAUSER15707
Affected version: OTP-22.0
Fixed in version: OTP-23.1
Component: kernel
Migrated from: https://bugs.erlang.org/browse/ERL-1299
The documentation for [file:pwrite/3|http://erlang.org/doc/man/file.html#pwrite-3] lists limitations when using this function with "raw" files, but there are similar limitations when used with "ram" files.
For example, the function fails when given "eof"
{code:erlang}
Erlang/OTP 22 [erts-10.7.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Eshell V10.7.1 (abort with ^G)
1> {ok, File} = file:open(<<"hello">>, [ram, write, read]).
{ok,{file_descriptor,ram_file,#Port<0.6>}}
2> file:pwrite(File, eof, <<" world">>).
{error,badarg}
3>
{code}
but works when given an integer position
{code:erlang}
Erlang/OTP 22 [erts-10.7.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Eshell V10.7.1 (abort with ^G)
1> {ok, File} = file:open(<<"hello">>, [ram, write, read]).
{ok,{file_descriptor,ram_file,#Port<0.6>}}
2> file:pwrite(File, 5, <<" world">>).
ok
3>
{code}
Either the documentation should be fixed to report the limitations of using this function with "ram" files, or this function should be fixed to remove this limitation with "ram" files.
Thanks.
The text was updated successfully, but these errors were encountered:
Original reporter:
JIRAUSER15707
Affected version:
OTP-22.0
Fixed in version:
OTP-23.1
Component:
kernel
Migrated from: https://bugs.erlang.org/browse/ERL-1299
The text was updated successfully, but these errors were encountered: