Monday, September 29, 2008

debut enumerateDirectory and some housekeeping

I've just checked in the method org.icongarden.fileSystem.enumerateDirectory. Like its sibling setWorkingDirectory, it takes a single parameter which must be an array of pathname components as returned by its sibling getWorkingDirectory. It returns an array of directory entry names objects whose properties name, type, and inode describe each directory entry. If I end up supporting Windows, inode won't be present. type has one of the following values:
  • (unknown to extension)
  • (unknown to system)
  • regular file
  • directory
  • named pipe
  • socket
  • character device
  • block device
  • symbolic link
On Windows, not all of these will be possibilities.

I've retired org.icongarden.workingDirectory, and org.icongarden.fileSystem will have a much broader scope. I always intended to have a org.icongarden.fileSystem; I don't know why I got distracted with org.icongarden.workingDirectory.

I also tweaked the way exceptions are thrown in C++ so it's easier to "demand" that conditions be true in a way which causes a JavaScript exception if they're not. Making this super-convenient is key to actually doing it often enough to be useful to JavaScript programmers.

No comments: