getstreameol {Rstreams}R Documentation

Determine a Stream's End-of-Line Marker

Description

Examines a stream to determine the end-of-line marker.

Usage

  getstreameol(s)

Arguments

s an already opened stream.

Details

Reads characters from the stream until it finds a CR, LF, or CR/LF end of line marker. These are the defaults used in text files on the Mac, Unix, and PCs respectively. Returns marker in a string, as '\r', '\n', or '\r\n'.

Value

A character variable holding the end-of-line marker.

See Also

readlines,openstream

Examples

dump("getstreameol","mydata")
s <- openstream("mydata")
getstreameol(s)
closestream(s)
unlink("mydata")