aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2017-10-11 15:18:22 +0200
committerJohn Högberg <[email protected]>2017-11-30 15:44:36 +0100
commit5273bc7c0fcf5354922eb3fd2eaf7c3e5ded6440 (patch)
tree0c07da75541a706710039f052a6d5f7ca084ca24
parent122d54acae3bac94c223b7d809cb78a08c934116 (diff)
downloadotp-5273bc7c0fcf5354922eb3fd2eaf7c3e5ded6440.tar.gz
otp-5273bc7c0fcf5354922eb3fd2eaf7c3e5ded6440.tar.bz2
otp-5273bc7c0fcf5354922eb3fd2eaf7c3e5ded6440.zip
Volume-relative paths must work on Windows
-rw-r--r--lib/kernel/test/file_SUITE.erl22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl
index 5e5e7cf6b2..6139d2161e 100644
--- a/lib/kernel/test/file_SUITE.erl
+++ b/lib/kernel/test/file_SUITE.erl
@@ -99,6 +99,8 @@
-export([unicode_mode/1]).
+-export([volume_relative_paths/1]).
+
-export([tiny_writes/1, tiny_writes_delayed/1,
large_writes/1, large_writes_delayed/1,
tiny_reads/1, tiny_reads_ahead/1]).
@@ -126,8 +128,8 @@ suite() ->
all() ->
[unicode, altname, read_write_file, {group, dirs},
- {group, files}, delete, rename, names, {group, errors},
- {group, compression}, {group, links}, copy,
+ {group, files}, delete, rename, names, volume_relative_paths,
+ {group, errors}, {group, compression}, {group, links}, copy,
delayed_write, read_ahead, segment_read, segment_write,
ipread, pid2name, interleaved_read_write, otp_5814, otp_10852,
large_file, large_write, read_line_1, read_line_2, read_line_3,
@@ -2120,6 +2122,22 @@ names(Config) when is_list(Config) ->
[] = flush(),
ok.
+volume_relative_paths(Config) when is_list(Config) ->
+ case os:type() of
+ {win32, _} ->
+ {ok, [Drive, $: | _]} = file:get_cwd(),
+ %% Relative to current device root.
+ {ok, RootInfo} = file:read_file_info([Drive, $:, $/]),
+ {ok, RootInfo} = file:read_file_info("/"),
+ %% Relative to current device directory.
+ {ok, DirContents} = file:list_dir([Drive, $:]),
+ {ok, DirContents} = file:list_dir("."),
+ [] = flush(),
+ ok;
+ _ ->
+ {skip, "This test is Windows-specific."}
+ end.
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%