diff options
author | John Högberg <[email protected]> | 2017-10-13 13:23:49 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2017-11-30 15:44:33 +0100 |
commit | 1d0aa9e9d621d4ce654a62a462c9a7f13cddaf65 (patch) | |
tree | c240140f809e16306015eaed894986dfeca64048 | |
parent | e767da08af42e8fae0fa8bb8789a45a390ec8c0b (diff) | |
download | otp-1d0aa9e9d621d4ce654a62a462c9a7f13cddaf65.tar.gz otp-1d0aa9e9d621d4ce654a62a462c9a7f13cddaf65.tar.bz2 otp-1d0aa9e9d621d4ce654a62a462c9a7f13cddaf65.zip |
Test opening raw files in the same manner as regular ones
-rw-r--r-- | lib/kernel/test/file_SUITE.erl | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index e35394ab53..1a472af279 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -2060,13 +2060,22 @@ names(Config) when is_list(Config) -> ok = ?FILE_MODULE:close(Fd2), {ok,Fd3} = ?FILE_MODULE:open(Name3,read), ok = ?FILE_MODULE:close(Fd3), + + %% Now try the same on raw files. + {ok,Fd4} = ?FILE_MODULE:open(Name2, [read, raw]), + ok = ?FILE_MODULE:close(Fd4), + {ok,Fd4f} = ?FILE_MODULE:open(lists:flatten(Name2), [read, raw]), + ok = ?FILE_MODULE:close(Fd4f), + {ok,Fd5} = ?FILE_MODULE:open(Name3, [read, raw]), + ok = ?FILE_MODULE:close(Fd5), + case length(Name1) > 255 of true -> io:format("Path too long for an atom:\n\n~p\n", [Name1]); false -> Name4 = list_to_atom(Name1), - {ok,Fd4} = ?FILE_MODULE:open(Name4,read), - ok = ?FILE_MODULE:close(Fd4) + {ok,Fd6} = ?FILE_MODULE:open(Name4,read), + ok = ?FILE_MODULE:close(Fd6) end, %% Try some path names |