Skip to content

OS.FileSys.readDir conformance #18

@ratmice

Description

@ratmice

Noticed a minor issue in the implementation of OS.FileSys.readDir,
According to sml-family

readDir filters out the names corresponding to the current and parent arcs.

I had not quite figured out how to generate the whole .ans file, etc

(* Result: FAIL *)
(* Test OS.FileSys.readDir, should return false. *)
fun hasParentOrCurrentArc() =
  let val cwd = OS.FileSys.openDir(OS.Path.currentArc)
      fun hasParentOrCurrentArc(d, flag) =
          let val entry = OS.FileSys.readDir(d)
              fun check(entry) = 
                String.compare(entry, OS.Path.parentArc) = General.EQUAL
                orelse String.compare(entry, OS.Path.currentArc) = General.EQUAL
              fun ent (SOME entry, false) = hasParentOrCurrentArc(d, check(entry))
                | ent (SOME entry, true) = true
                | ent (NONE, flag) = flag 
           in ent (entry, flag)
          end
   in hasParentOrCurrentArc(cwd, false)
  end
val a = hasParentOrCurrentArc();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions