RosettaCodeData/Task/Check-that-file-exists/M2000-Interpreter/check-that-file-exists.m2000
2023-07-01 13:44:08 -04:00

18 lines
670 B
Text

Module ExistDirAndFile {
Let WorkingDir$=Dir$, RootDir$="C:\"
task(WorkingDir$)
task(RootDir$)
Dir User ' return to user directroy
Sub task(WorkingDir$)
Local counter
Dir WorkingDir$
If Not Exist.Dir("docs") then Report "docs not exist in "+WorkingDir$ : counter++
If Not Exist("output.txt") Then {
Report "output.txt not exist in "+ WorkingDir$ : counter++
} Else.if Filelen("output.txt")=0 Then Report "output.txt has zero length"
If counter =0 then Report WorkingDir$+ " has docs directory and file output.txt"
End Sub
}
ExistDirAndFile