references/sleep-functions/closef.md

GitHub

closef

Category: InputOutput

Source: https://sleep.dashnine.org/manual/closef.html


Synopsis

closef($handle)

Closes the read and write channels for the specified I/O handle

closef(port)

Locates the specified port in the server socket listen table and closes it

Parameters

$handle - an Object scalar containing a Sleep I/O reference handle.

port - the port number to stop listening for connections on

Examples

Example:

# overwrite data.txt

$handle = openf(">data.txt");
println($handle, "this is some data.");
closef($handle);

See Also

&available; &consume; &mark; &printEOF; &reset; &setEncoding; &skip; &wait