dummix: fuck this shit

Former-commit-id: 7d9983b50f218611c2d482723a88851e13fca3d0
Former-commit-id: 3891c23fd13248a869f8611dc3185d2a7a564d51
This commit is contained in:
Song Minjae
2016-10-05 22:32:37 +09:00
parent 8a71a4c852
commit 8b4baa77a4
10 changed files with 96 additions and 33 deletions

View File

@@ -139,6 +139,8 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) {
override fun call(path: LuaValue) : LuaValue {
Filesystem.ensurePathSanity(path)
println("ListFiles: got path ${path.checkIBM437()}")
val table = LuaTable()
val file = File(computer.getRealPath(path)).absoluteFile
try {
@@ -162,7 +164,10 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) {
override fun call(path: LuaValue) : LuaValue {
Filesystem.ensurePathSanity(path)
return LuaValue.valueOf(Files.isDirectory(Paths.get(computer.getRealPath(path)).toAbsolutePath()))
val isDir = Files.isDirectory(Paths.get(computer.getRealPath(path)).toAbsolutePath())
val exists = Files.exists(Paths.get(computer.getRealPath(path)).toAbsolutePath())
return LuaValue.valueOf(isDir || exists)
}
}