Extracted from Pike v7.6 release 61 at 2005-12-30.
pike.ida.liu.se
[Top]
Stdio
Stdio.File

Method Stdio.File()->close()


Method close

int close()
int close(string direction)

Description

Close a file or stream.

If direction is not specified, both the read and the write direction will be closed. Otherwise only the directions specified will be closed.

Returns

Nonzero is returned if the file or stream wasn't open in the specified direction, zero otherwise.

Throws

An exception is thrown if an I/O error occurs.

Note

close() has no effect if this file object has been associated with an already opened file, i.e. if open() was given an integer as the first argument.

See also

open() , open_socket()


Method close

int close()
int close(string direction)

Description

Close the file. Optionally, specify "r", "w" or "rw" to close just the read, just the write or both read and write directions of the file respectively.

An exception is thrown if an I/O error occurs.

Returns

Nonzero is returned if the file wasn't open in the specified direction, zero otherwise.

Note

This function will not call the close_callback.

See also

open , open_socket