JSFileApi: Difference between revisions

25 bytes added ,  30 September 2011
no edit summary
No edit summary
Line 265: Line 265:
= Instances of FileDescriptor =  
= Instances of FileDescriptor =  


A {FileDescriptor} is a low-level object wrapping a native file descriptor (under variants of Unix) or a file handle (under Windows).
A <tt>FileDescriptor</tt> is a low-level object wrapping a native file descriptor (under variants of Unix) or a file handle (under Windows).


== Reading ==
== Reading ==
Line 369: Line 369:
     },
     },
   
   
== Not implemented ==
* chmod, chown -- very different between platforms - might implement platform-specific functions
* select, poll, ... -- very different between platforms, higher level
* mmap -- probably feasible, just might require additional API
* locking -- very different between platforms, most likely deserves its own API
* linking -- very different between platforms
* readString, writeString -- ArrayBuffer <-> String conversion most likely deserves its own API
= Instances of DirectoryDescriptor =
= Instances of DirectoryDescriptor =


A {DirectoryDescriptor} is a slightly higher-level object wrapping a directory _name_ (for reasons of portability & iteration, this seemed more appropriate than _opening_ the directory during construction). On the Unix side, some of the methods rely upon (or have to reimplement) systems that obey recent versions of Posix, with functions such as {openat}.
A <tt>DirectoryDescriptor</tt> is a slightly higher-level object wrapping a directory _name_ (for reasons of portability & iteration, this seemed more appropriate than _opening_ the directory during construction). On the Unix side, some of the methods rely upon (or have to reimplement) systems that obey recent versions of Posix, with functions such as <tt>openat</tt>.


== Opening/creating ==
== Opening/creating ==
Line 396: Line 387:
       */
       */
     openFile: function(leafName, accessMode, contentMode, pragmaMode) {
     openFile: function(leafName, accessMode, contentMode, pragmaMode) {
  //Unix:    maps to [openat] (warning, this requires gnulib on non-Linux platforms)
  //Unix:    maps to [openat] (warning, this requires gnulib on non-Linux Unix platforms)
  //Windows:  cf. [FileDescriptor.open]
  //Windows:  cf. [FileDescriptor.open]
     },
     },
Line 447: Line 438:
  //Unix:    maps to [opendir], [dfd], [readdir]/[readdir64], lazy calls to [stat]
  //Unix:    maps to [opendir], [dfd], [readdir]/[readdir64], lazy calls to [stat]
  //Windows: maps to [FindFirstFile], [FindNextFile], [Close]
  //Windows: maps to [FindFirstFile], [FindNextFile], [Close]
= Not implemented =
* chmod, chown -- very different between platforms - might implement platform-specific functions
* select, poll, ... -- very different between platforms, higher level
* mmap -- probably feasible, just might require additional API
* locking -- very different between platforms, most likely deserves its own API
* linking -- very different between platforms
* readString, writeString -- ArrayBuffer <-> String conversion most likely deserves its own API
184

edits