Skip to content

Commit 30ec0c4

Browse files
authored
Merge pull request #5 from kansof/feature/add_extra_constructor
Add fabric method for path related to file
2 parents de8fcea + 85aaf11 commit 30ec0c4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/commonMain/kotlin/File.common.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ expect class File(pathname: String) {
2727

2828
expect val filePathSeparator: Char
2929

30+
fun File.asParent(child: String): File {
31+
val path = getAbsolutePath() + filePathSeparator + child
32+
return File(path)
33+
}
34+
3035
val File.nameWithoutExtension: String
3136
get() = getName().substringBeforeLast(".")
3237

0 commit comments

Comments
 (0)