filebuf::attach

Syntax

filebuf* attach( filedesc fd );

Parameters

fd

A file descriptor as returned by a call to the run-time function _open or _sopen. filedesc is a typedef equivalent to int.

Remarks

Attaches this filebuf object to the open file specified by fd.

Return Value

NULL when the stream is already attached to a file; otherwise it returns its own address.