diff options
author | Siri Hansen <[email protected]> | 2013-06-04 11:15:17 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2013-06-04 11:15:17 +0200 |
commit | 4a25ec13e624989af191a2297f904df87d8e3248 (patch) | |
tree | 91432765cf61c01ccd0682075004fb45d4054052 /lib/kernel/test/file_SUITE.erl | |
parent | ca98e0725a3cb604bda6f3ab579dbcdb387dc180 (diff) | |
parent | a58a2987ab699b452dd1c95dca62147a827e7c7f (diff) | |
download | otp-4a25ec13e624989af191a2297f904df87d8e3248.tar.gz otp-4a25ec13e624989af191a2297f904df87d8e3248.tar.bz2 otp-4a25ec13e624989af191a2297f904df87d8e3248.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/kernel/test/file_SUITE.erl')
-rw-r--r-- | lib/kernel/test/file_SUITE.erl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index 4218cfa646..e4c8f0ffaf 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -2651,6 +2651,8 @@ symlinks(Config) when is_list(Config) -> ?line #file_info{links=1, type=symlink} = Info2, ?line {ok, Name} = ?FILE_MODULE:read_link(Alias), {ok, Name} = ?FILE_MODULE:read_link_all(Alias), + %% If all is good, delete dir again (avoid hanging dir on windows) + rm_rf(?FILE_MODULE,NewDir), ok end, @@ -4304,3 +4306,18 @@ disc_free(Path) -> memsize() -> {Tot,_Used,_} = memsup:get_memory_data(), Tot. + +%%%----------------------------------------------------------------- +%%% Utilities +rm_rf(Mod,Dir) -> + case Mod:read_link_info(Dir) of + {ok, #file_info{type = directory}} -> + {ok, Content} = Mod:list_dir_all(Dir), + [ rm_rf(Mod,filename:join(Dir,C)) || C <- Content ], + Mod:del_dir(Dir), + ok; + {ok, #file_info{}} -> + Mod:delete(Dir); + _ -> + ok + end. |