Skip to content

Commit d5a9eb1

Browse files
committed
introduce followSymbolicLink
- implements #13
1 parent 1afd89b commit d5a9eb1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/kotlin/ch/tutteli/niok/PathDelegateToFiles.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ inline fun Path.deleteIfExists(): Boolean = Files.deleteIfExists(this)
5959
*/
6060
inline val Path.exists get(): Boolean = Files.exists(this)
6161

62+
/**
63+
* Assumes that this path [Path.isSymbolicLink] and delegates to [Files.readSymbolicLink].
64+
*/
65+
inline fun Path.followSymbolicLink() = Files.readSymbolicLink(this)
66+
6267
/**
6368
* Delegates to [Files.isDirectory] without [LinkOption]s.
6469
*/

0 commit comments

Comments
 (0)