Talk:IO/B/Filesystem/Level0

From CommonJS Spec Wiki
Jump to: navigation, search
  1. you still use OpaqueLeaf. as i mentioned before, Leaf bad term
  2. all the listXXX functions are odd.
    • a) can't list on a file either
  3. open doesn't make sense on a dir
  4. 2+3 imply to me that its worht separating into Dir only, File only, and common (Path or Entity)
  5. isFile isn't always !isDir (fifo,socket, etc)
  6. should probably have an lstat to go with your stat
  7. createDir should die if it fails, not return false.
  8. ditto for anything else that returns false on failure. (setLastModified)
  9. lastModified returning a date or false is odd od odd. Date or undefined/null, or perhaps even die

Ashb 20:14, 3 October 2009 (UTC)

  1. couldn't come up with a new name yet
  2. listXXX are due to open/read/close dir not being portable (Java replaces them with a variety of list functions which can be filtered in different ways).
    • a) Course, it errors
  3. Course, it errors
  4. The other apis didn't exactly do it... and it's not really a common thing to do. I don't see a reason. Especially since this is level0.
  5. I know, I debated an isOther, thought !isFile !isDirectory would do, Java doesn't provide this either. I could make a note though.
  6. stat is lstat; stat and lstat work on file descriptors and paths, an Opaque in that api would be a path, file descriptors don't exist on opaques, file descriptors are used by streams, another stat would require a stat in the stream api.
  7. Java doesn't throw errors, what about other engines? Throwing an error when a directory you want to exist already exists sounds strange.
  8. I was avoiding custom errors at this level, this is a low level interface, IMHO not the place for custom errors that are hard to implement in JS engines.
  9. To match up with other methods
Daniel Friesen05:25, 4 October 2009 (UTC)