readCompletionNotification
TypeScriptstatic get readCompletionNotification(): NSNotification_NameSwift declarationclass let readCompletionNotification: NSNotification.Nameclass · SDK 27.1
class FileHandlestatic get readCompletionNotification(): NSNotification_NameSwift declarationclass let readCompletionNotification: NSNotification.Namestatic initForReadingAtPath(path: string): (FileHandle) | nullSwift declarationconvenience init?(forReadingAtPath path: String)static initForReadingFrom(url: string): FileHandleSwift declarationconvenience init(forReadingFrom url: URL) throwsstatic initForUpdatingAtPath(path: string): (FileHandle) | nullSwift declarationconvenience init?(forUpdatingAtPath path: String)static initForUpdating(url: string): FileHandleSwift declarationconvenience init(forUpdating url: URL) throwsstatic initForWritingAtPath(path: string): (FileHandle) | nullSwift declarationconvenience init?(forWritingAtPath path: String)static initForWritingTo(url: string): FileHandleSwift declarationconvenience init(forWritingTo url: URL) throwsstatic get nullDevice(): FileHandleSwift declarationclass var nullDevice: FileHandle { get }static get standardError(): FileHandleSwift declarationclass var standardError: FileHandle { get }static get standardInput(): FileHandleSwift declarationclass var standardInput: FileHandle { get }static get standardOutput(): FileHandleSwift declarationclass var standardOutput: FileHandle { get }acceptConnectionInBackgroundAndNotify(): voidSwift declarationfunc acceptConnectionInBackgroundAndNotify()acceptConnectionInBackgroundAndNotifyForModes(modes?: (Array<RunLoop_Mode>) | null): voidSwift declarationfunc acceptConnectionInBackgroundAndNotify(forModes modes: [RunLoop.Mode]?)close(): voidSwift declarationfunc close() throwscloseFile(): voidSwift declarationfunc closeFile()static initCoder(coder: NSCoder): (FileHandle) | nullSwift declarationinit?(coder: NSCoder)static initFileDescriptor(fd: number): FileHandleSwift declarationconvenience init(fileDescriptor fd: Int32)static initFileDescriptorCloseOnDealloc(fd: number, closeopt: boolean): FileHandleSwift declarationinit(fileDescriptor fd: Int32, closeOnDealloc closeopt: Bool)readData(length: number): ArrayBufferSwift declarationfunc readData(ofLength length: Int) -> DatareadDataToEndOfFile(): ArrayBufferSwift declarationfunc readDataToEndOfFile() -> DatareadInBackgroundAndNotify(): voidSwift declarationfunc readInBackgroundAndNotify()readInBackgroundAndNotifyForModes(modes?: (Array<RunLoop_Mode>) | null): voidSwift declarationfunc readInBackgroundAndNotify(forModes modes: [RunLoop.Mode]?)readToEndOfFileInBackgroundAndNotify(): voidSwift declarationfunc readToEndOfFileInBackgroundAndNotify()readToEndOfFileInBackgroundAndNotifyForModes(modes?: (Array<RunLoop_Mode>) | null): voidSwift declarationfunc readToEndOfFileInBackgroundAndNotify(forModes modes: [RunLoop.Mode]?)seekToEndOfFile(): numberSwift declarationfunc seekToEndOfFile() -> UInt64seekToFileOffset(offset: number): voidSwift declarationfunc seek(toFileOffset offset: UInt64)seekToOffset(offset: number): voidSwift declarationfunc seek(toOffset offset: UInt64) throwssynchronize(): voidSwift declarationfunc synchronize() throwssynchronizeFile(): voidSwift declarationfunc synchronizeFile()truncate(offset: number): voidSwift declarationfunc truncate(atOffset offset: UInt64) throwstruncateFile(offset: number): voidSwift declarationfunc truncateFile(atOffset offset: UInt64)waitForDataInBackgroundAndNotify(): voidSwift declarationfunc waitForDataInBackgroundAndNotify()waitForDataInBackgroundAndNotifyForModes(modes?: (Array<RunLoop_Mode>) | null): voidSwift declarationfunc waitForDataInBackgroundAndNotify(forModes modes: [RunLoop.Mode]?)write(data: ArrayBuffer): voidSwift declarationfunc write(_ data: Data)get availableData(): ArrayBufferSwift declarationvar availableData: Data { get }get fileDescriptor(): numberSwift declarationvar fileDescriptor: Int32 { get }get offsetInFile(): numberSwift declarationvar offsetInFile: UInt64 { get }get readabilityHandler(): (((arg0: FileHandle) => Promise<void>)) | nullSwift declarationvar readabilityHandler: (@Sendable (FileHandle) -> Void)? { get set }set readabilityHandler(value: (((arg0: FileHandle) => void)) | null)Swift declarationvar readabilityHandler: (@Sendable (FileHandle) -> Void)? { get set }get writeabilityHandler(): (((arg0: FileHandle) => Promise<void>)) | nullSwift declarationvar writeabilityHandler: (@Sendable (FileHandle) -> Void)? { get set }set writeabilityHandler(value: (((arg0: FileHandle) => void)) | null)Swift declarationvar writeabilityHandler: (@Sendable (FileHandle) -> Void)? { get set }read(count: number): (ArrayBuffer) | nullSwift declarationfunc read(upToCount count: Int) throws -> Data?Reads data synchronously up to the specified number of bytes. - Parameter count: The number of bytes to read from the file handle. - Returns: The data available through the receiver up to a maximum of `count` bytes, or the maximum size that can be represented by an `NSData` object, whichever is the smaller. If the handle represents a file, this method returns the data obtained by reading `count` bytes starting at the current file pointer. If `count` bytes aren't available, this method returns the data obtained by reading bytes up to the end of the file. If the handle represents a communications channel, this method reads up to `count` bytes from the channel.
get bytes(): FileHandle_AsyncBytesSwift declarationvar bytes: FileHandle.AsyncBytes { get }The file's contents, as an asynchronous sequence of bytes. Use the `for`-`await`-`in` syntax to iterate over the bytes in this sequence. For text files, you can also use its `characters`, `unicodeScalars`, or `lines` properties to retrieve the contents in a more convenient format. > Tip: Rather than creating a ``FileHandle`` to read a file asynchronously, you can instead use a `file://` URL in combination with the `URL.resourceBytes` property.
writeContentsOf(data: ArrayBuffer): voidSwift declarationfunc write<T>(contentsOf data: T) throws where T : DataProtocolWrites the specified data synchronously to the file handle. - Parameter data: The data to write to the file handle. If the handle represents a file, writing takes place at the file pointer's current position. After it writes the data, the method advances the file pointer by the number of bytes written. This method throws an error if the file descriptor is closed or isn't valid, if the handle represents an unconnected pipe or socket endpoint, if there isn't any free space on the file system, or if any other writing error occurs.
offset(): numberSwift declarationfunc offset() throws -> UInt64Gets the position of the file pointer within the file. - Returns: The position of the file pointer within the file. Throws an error if called on a file handle representing a pipe or socket, or if the file descriptor is closed.
readToEnd(): (ArrayBuffer) | nullSwift declarationfunc readToEnd() throws -> Data?Reads the available data synchronously up to the end of file or maximum number of bytes. - Returns: The data available through the file handle up to the maximum size that can be represented by an `NSData` object or, if a communications channel, until an end-of-file indicator is returned. This method invokes ``readData(ofLength:)`` as part of its implementation.
seekToEnd(): numberSwift declaration@discardableResult func seekToEnd() throws -> UInt64Places the file pointer at the end of the file referenced by the file handle and returns the new file offset. - Returns: The file offset with the file pointer at the end of the file. This is therefore equal to the size of the file. Throws an error if called a file handle representing a pipe or socket, or if the file descriptor is closed.
1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
FileHandle.init()
inherited init: cannot prove legal (class declares 11 custom initializers)