14 lines
463 B
Plaintext
14 lines
463 B
Plaintext
// Create file handles for standard input and output
|
|
FileHandleRef stdIn = fn FileHandleWithStandardInput
|
|
FileHandleRef stdOut = fn FileHandleWithStandardOutput
|
|
|
|
// Continuously read from standard input…
|
|
while (YES)
|
|
CFDataRef availableData = fn FileHandleAvailableData( stdIn )
|
|
if ( fn DataLength( availableData ) == 0 )
|
|
break // End of input
|
|
end if
|
|
// … and write to standard output
|
|
fn FileHandleWriteData( stdOut, availableData, NULL )
|
|
wend
|