diff options
author | Henrik Nord <[email protected]> | 2011-04-29 16:12:59 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-04-29 16:16:00 +0200 |
commit | 0e752dde5e322373055c810386353e1d2cc61836 (patch) | |
tree | c47c6178b08923787d2b9e5f78b9c87c606d5855 /erts | |
parent | c302809fbe5b3873d5c459da11ed49ea73a6739f (diff) | |
parent | e56d1c13d3cfa3370d1bed63ab8a0804a9bb3951 (diff) | |
download | otp-0e752dde5e322373055c810386353e1d2cc61836.tar.gz otp-0e752dde5e322373055c810386353e1d2cc61836.tar.bz2 otp-0e752dde5e322373055c810386353e1d2cc61836.zip |
Merge branch 'ks/prim_file-fixes' into dev
* ks/prim_file-fixes:
add prim_file.beam
Driver names should be strings, not atoms
Cleanup and cosmetic changes
OTP-9253
Diffstat (limited to 'erts')
-rw-r--r-- | erts/preloaded/ebin/prim_file.beam | bin | 31548 -> 31588 bytes | |||
-rw-r--r-- | erts/preloaded/src/prim_file.erl | 24 |
2 files changed, 11 insertions, 13 deletions
diff --git a/erts/preloaded/ebin/prim_file.beam b/erts/preloaded/ebin/prim_file.beam Binary files differindex 4a75e43e73..c2ae01d0d5 100644 --- a/erts/preloaded/ebin/prim_file.beam +++ b/erts/preloaded/ebin/prim_file.beam diff --git a/erts/preloaded/src/prim_file.erl b/erts/preloaded/src/prim_file.erl index 10be852e92..fb0aef8947 100644 --- a/erts/preloaded/src/prim_file.erl +++ b/erts/preloaded/src/prim_file.erl @@ -64,7 +64,7 @@ -include("file.hrl"). -define(DRV, efile). --define(FD_DRV, efile). +-define(FD_DRV, "efile"). -define(LARGEFILESIZE, (1 bsl 63)). @@ -506,7 +506,7 @@ read_file(_) -> %% Takes a Port opened with open/1. read_file(Port, File) when is_port(Port), - (is_list(File) orelse is_binary(File))-> + (is_list(File) orelse is_binary(File)) -> Cmd = [?FILE_READ_FILE | pathname(File)], case drv_command(Port, Cmd) of {error, enomem} -> @@ -832,7 +832,7 @@ drv_open(Driver, Portopts) -> {ok, Port} catch error:Reason -> - {error,Reason} + {error, Reason} end. @@ -1041,8 +1041,8 @@ translate_response(?FILE_RESP_NUMBER, List) -> {N, []} = get_uint64(List), {ok, N}; translate_response(?FILE_RESP_DATA, List) -> - {N, Data} = get_uint64(List), - {ok, {N, Data}}; + {_N, _Data} = ND = get_uint64(List), + {ok, ND}; translate_response(?FILE_RESP_INFO, List) when is_list(List) -> {ok, transform_info_ints(get_uint32s(List))}; translate_response(?FILE_RESP_NUMERR, L0) -> @@ -1087,10 +1087,8 @@ translate_response(?FILE_RESP_FNAME, Data) when is_binary(Data) -> {ok, prim_file:internal_native2name(Data)}; translate_response(?FILE_RESP_FNAME, Data) -> {ok, Data}; - translate_response(?FILE_RESP_ALL_DATA, Data) -> {ok, Data}; - translate_response(X, Data) -> {error, {bad_response_from_port, [X | Data]}}. @@ -1137,14 +1135,14 @@ date_to_bytes(undefined) -> date_to_bytes({{Y, Mon, D}, {H, Min, S}}) -> <<Y:32, Mon:32, D:32, H:32, Min:32, S:32>>. -% uint64([[X1, X2, X3, X4] = Y1 | [X5, X6, X7, X8] = Y2]) -> -% (uint32(Y1) bsl 32) bor uint32(Y2). +%% uint64([[X1, X2, X3, X4] = Y1 | [X5, X6, X7, X8] = Y2]) -> +%% (uint32(Y1) bsl 32) bor uint32(Y2). -% uint64(X1, X2, X3, X4, X5, X6, X7, X8) -> -% (uint32(X1, X2, X3, X4) bsl 32) bor uint32(X5, X6, X7, X8). +%% uint64(X1, X2, X3, X4, X5, X6, X7, X8) -> +%% (uint32(X1, X2, X3, X4) bsl 32) bor uint32(X5, X6, X7, X8). -% uint32([X1,X2,X3,X4]) -> -% (X1 bsl 24) bor (X2 bsl 16) bor (X3 bsl 8) bor X4. +%% uint32([X1,X2,X3,X4]) -> +%% (X1 bsl 24) bor (X2 bsl 16) bor (X3 bsl 8) bor X4. uint32(X1,X2,X3,X4) -> (X1 bsl 24) bor (X2 bsl 16) bor (X3 bsl 8) bor X4. |