184
edits
No edit summary |
(Split in sections, subsections, etc.) |
||
Line 1: | Line 1: | ||
This page details a proposal for [[https://bugzilla.mozilla.org/show_bug.cgi?id=563742|Bug 563742 - Efficient ctypes API for file handling]]. | |||
The general idea of this API is to provide a low-level, cross-platform, fast access to file management functions. For this reason, it does not implement some primitives that are very different between platforms, e.g. chmod, mmap, epoll. | |||
By the way, this document uses the conventions of [[http://code.google.com/closure/compiler/docs/js-for-compiler.html|the Google Closure Compiler]] for type annotations. | |||
= Module FileUtilities = | = Module FileUtilities = | ||
This module is the first access point to the file API. It contains constructors, functions to copy, move files, etc. as well as the constants used in the API. | |||
== Access a file or a directory == | == Access a file or a directory == | ||
Line 265: | Line 274: | ||
= 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). | |||
== Reading == | == Reading == | ||
Line 418: | Line 429: | ||
= 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}. | |||
== Opening/creating == | == Opening/creating == |
edits