# Io Reference

Filesystem / AsyncRequest / AsyncRequest

|  | Used for doing asynchronous file i/o. When this addon is loaded, it will override the File proto's readToBufferLength, readBufferOfLength and write methods to automatically use AsyncRequests. Note: This addon is only needed for async file requests - all socket ops are already asynchronous in Io.
|  | cancel Cancels the request. Returns nil on error or self otherwise. copyBufferto(aSeq) Copies the request buffer's data to aSeq. Returns nil on error or self otherwise. descriptor Returns the descriptor for the request. error Returns sequence containing the last error or nil otherwise. isDone Returns true if the request is done, false otherwise. numberOfBytes Returns the number of bytes associated with the request. position Returns a Number for the position of the descriptor. read(aSeq, numberOfBytes) Submits an async read request. Returns nil on error, self otherwise. setDescriptor(aDescriptorNumber) Sets the descriptor for the receiver. Returns self. sync Waits for the request to complete. Returns nil on error or self otherwise. write(fileOffset, aSeq, bufferOffset, numberOfBytesToWrite) Submits an async write request. Returns nil on error, self otherwise.