diff options
author | Anthony Ramine <[email protected]> | 2014-06-26 12:57:20 +0200 |
---|---|---|
committer | Anthony Ramine <[email protected]> | 2014-06-30 11:31:48 +0200 |
commit | 146b82a241a1940de62b47123bfcab322df69759 (patch) | |
tree | 78bebeb4157669892bd180e1ae6a099007c4b756 /lib/kernel/src | |
parent | c9e36ab16034bb7fe71f772df6bba22070976bbf (diff) | |
download | otp-146b82a241a1940de62b47123bfcab322df69759.tar.gz otp-146b82a241a1940de62b47123bfcab322df69759.tar.bz2 otp-146b82a241a1940de62b47123bfcab322df69759.zip |
Remove untested option 'raw_files' from file module
This undocumented option makes an application:get_env/2 call every time a raw
file is opened.
Diffstat (limited to 'lib/kernel/src')
-rw-r--r-- | lib/kernel/src/file.erl | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/lib/kernel/src/file.erl b/lib/kernel/src/file.erl index 20b703e084..c3047bad44 100644 --- a/lib/kernel/src/file.erl +++ b/lib/kernel/src/file.erl @@ -431,21 +431,15 @@ open(Item, ModeList) when is_list(ModeList) -> case lists:member(raw, ModeList) of %% Raw file, use ?PRIM_FILE to handle this file true -> - %% check if raw file mode is disabled - case catch application:get_env(kernel, raw_files) of - {ok,false} -> - open(Item, lists:delete(raw, ModeList)); - _ -> % undefined | {ok,true} - Args = [file_name(Item) | ModeList], - case check_args(Args) of - ok -> - [FileName | _] = Args, - %% We rely on the returned Handle (in {ok, Handle}) - %% being a pid() or a #file_descriptor{} - ?PRIM_FILE:open(FileName, ModeList); - Error -> - Error - end + Args = [file_name(Item) | ModeList], + case check_args(Args) of + ok -> + [FileName | _] = Args, + %% We rely on the returned Handle (in {ok, Handle}) + %% being a pid() or a #file_descriptor{} + ?PRIM_FILE:open(FileName, ModeList); + Error -> + Error end; false -> case lists:member(ram, ModeList) of |