4

This question is in principal the same like these ones here

But is there a way to do the same in on sys target platforms in Haxe, without running ls / dir via sys.io.Process and parsing the results?

Gama11
  • 31,714
  • 9
  • 78
  • 100
quant
  • 2,184
  • 2
  • 19
  • 29

1 Answers1

12

Yes, you can use sys.FileSystem.readDirectory(path) for this.

Returns the names of all files and directories in the directory specified by path.

If path does not denote a valid directory, an exception is thrown.

If path is null, the result is unspecified.

If you need files to be listed recursively, this article from the Haxe Code Cookbook is a good reference (there's a section titled "Recursive loop through all directories / files").

Community
  • 1
  • 1
Gama11
  • 31,714
  • 9
  • 78
  • 100