Skip to content

Commit

Permalink
introduce followSymbolicLink
Browse files Browse the repository at this point in the history
- implements #13
  • Loading branch information
robstoll committed Sep 8, 2019
1 parent 1afd89b commit d5a9eb1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/kotlin/ch/tutteli/niok/PathDelegateToFiles.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ inline fun Path.deleteIfExists(): Boolean = Files.deleteIfExists(this)
*/
inline val Path.exists get(): Boolean = Files.exists(this)

/**
* Assumes that this path [Path.isSymbolicLink] and delegates to [Files.readSymbolicLink].
*/
inline fun Path.followSymbolicLink() = Files.readSymbolicLink(this)

/**
* Delegates to [Files.isDirectory] without [LinkOption]s.
*/
Expand Down

0 comments on commit d5a9eb1

Please sign in to comment.