aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2013-11-29 10:46:36 +0100
committerLukas Larsson <[email protected]>2013-11-29 10:46:36 +0100
commit670150ff9bfdce856c327fb76c30e58039df2cba (patch)
tree575e29d27c2dca7039f5dee0f87d4fc15f2c574f /lib/kernel/test
parent423d37395076528866c4b689c0f1e9b72dae58e1 (diff)
parentf47c818746c1df4055b1de8aabf47364f502274c (diff)
downloadotp-670150ff9bfdce856c327fb76c30e58039df2cba.tar.gz
otp-670150ff9bfdce856c327fb76c30e58039df2cba.tar.bz2
otp-670150ff9bfdce856c327fb76c30e58039df2cba.zip
Merge branch 'sv/file-osync/OTP-11498'
* sv/file-osync/OTP-11498: Add sync option to file:open/2 Conflicts: erts/preloaded/ebin/prim_file.beam
Diffstat (limited to 'lib/kernel/test')
-rw-r--r--lib/kernel/test/file_SUITE.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl
index e4c8f0ffaf..c75639ae7e 100644
--- a/lib/kernel/test/file_SUITE.erl
+++ b/lib/kernel/test/file_SUITE.erl
@@ -805,6 +805,20 @@ new_modes(Config) when is_list(Config) ->
?line {ok, [$\[]} = ?FILE_MODULE:read(Fd6, 1),
?line ok = ?FILE_MODULE:close(Fd6),
+ %% write and sync
+ case ?FILE_MODULE:open(Name1, [write, sync]) of
+ {ok, Fd7} ->
+ ok = io:write(Fd7, Marker),
+ ok = io:put_chars(Fd7, ".\n"),
+ ok = ?FILE_MODULE:close(Fd7),
+ {ok, Fd8} = ?FILE_MODULE:open(Name1, [read]),
+ {ok, Marker} = io:read(Fd8, prompt),
+ ok = ?FILE_MODULE:close(Fd8);
+ {error, enotsup} ->
+ %% for platforms that don't support the sync option
+ ok
+ end,
+
?line [] = flush(),
?line test_server:timetrap_cancel(Dog),
ok.