Skip to content

Commit 82230d4

Browse files
committed
Updated doc, removed some checks from the atomicMoveDir test
1 parent a086319 commit 82230d4

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

core/common/src/files/FileSystem.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ public sealed interface FileSystem {
6565
* filesystems (or different volumes, on Windows) and the operation could not be performed atomically,
6666
* [UnsupportedOperationException] is thrown.
6767
*
68+
* When [destination] is an existing directory, the operation may fail on some platforms
69+
* (on Windows, particularly).
70+
*
6871
* @param source the path to rename.
6972
* @param destination desired path name.
7073
*

core/common/test/files/SmokeFileTest.kt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,6 @@ class SmokeFileTest {
117117
FileSystem.System.atomicMove(src, dst)
118118
assertFalse(FileSystem.System.exists(src))
119119
assertTrue(FileSystem.System.exists(dst))
120-
121-
val src2 = createTempPath()
122-
FileSystem.System.createDirectories(src2)
123-
FileSystem.System.atomicMove(src2, dst)
124-
assertFalse(FileSystem.System.exists(src2))
125-
126-
val src3 = createTempPath()
127-
FileSystem.System.sink(src3).buffered().use { it.writeString("hehe") }
128-
assertFailsWith<IOException> { FileSystem.System.atomicMove(src3, dst) }
129-
130-
val dstFile = createTempPath()
131-
FileSystem.System.sink(dstFile).buffered().use { it.writeString("hehe") }
132-
val srcDir = createTempPath()
133-
FileSystem.System.createDirectories(srcDir)
134-
assertFailsWith<IOException> { FileSystem.System.atomicMove(srcDir, dstFile) }
135120
}
136121

137122
@Test

0 commit comments

Comments
 (0)