add - create Folder app 'Feufaro' to 'Documents' directory for windows
This commit is contained in:
parent
71c3e4eb1c
commit
5611222ffc
1 changed files with 15 additions and 1 deletions
|
|
@ -1,5 +1,19 @@
|
||||||
package mg.dot.feufaro
|
package mg.dot.feufaro
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
actual fun getConfigDirectoryPath(): String {
|
actual fun getConfigDirectoryPath(): String {
|
||||||
return System.getProperty("user.home")
|
val userHome = System.getProperty("user.home")
|
||||||
|
|
||||||
|
//Créer ..Documents\Feufaro
|
||||||
|
val documentsPath = File(userHome, "Documents")
|
||||||
|
val feufa2Folder = File(documentsPath, "Feufaro")
|
||||||
|
|
||||||
|
if (!feufa2Folder.exists()) {
|
||||||
|
val created = feufa2Folder.mkdirs()
|
||||||
|
if (created) {
|
||||||
|
println("CP:15: Dossier créé avec succès : ${feufa2Folder.absolutePath}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val path = feufa2Folder.absolutePath
|
||||||
|
return if (path.endsWith(File.separator)) path else path + File.separator /* avec '/' à la fin */
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue