progress with converter, as we now visit each directory and file path recursively

This commit is contained in:
2025-08-26 14:35:35 +01:00
parent 2080118568
commit 2070b30c7d
2 changed files with 17 additions and 13 deletions

BIN
dsc

Binary file not shown.

View File

@@ -18,20 +18,24 @@ struct
SOME path => SOME path =>
let let
val folderPath = String.concat [rootPath, "/", path] val folderPath = String.concat [rootPath, "/", path]
in val () = print (folderPath ^ "\n")
val () =
if OS.FileSys.isDir folderPath then if OS.FileSys.isDir folderPath then
(* handle folder *) (* handle recursive directory *)
let val newDir = OS.fileSys.openDir folderPath let val newDir = OS.FileSys.openDir folderPath
in loop (newDir, folderPath) in loop (newDir, folderPath)
end end
else if OS.FileSys.isLink folderPath then else if OS.FileSys.isLink folderPath then
(* continue looping and ignore *) (* ignore *)
loop (dir, rootPath) ()
else if endsWithDsc path then
(* is a file ending with .dsc extension *)
convertFile folderPath
else else
(* handle file, if file has ".dsc" at the end *) (* is a file but doesn't end with .dsc, so ignore *)
let val () = if endsWithDsc path then convertFile folderPath else () ()
in loop (dir, rootPath) in
end loop (dir, rootPath)
end end
| NONE => OS.FileSys.closeDir dir | NONE => OS.FileSys.closeDir dir