Input/Output
File Stream
Read/Write from/to an opened stream.
To read a file we can use open
with the correct modifier and then read its contents with a proper method:
r
: read only streamr+
: read and write stream
If open
is followed by a block, the file object is passed to the block and the stream is automatically closed at block termination. Inside the block, you have a file object, and you can use different methods as read
, each
, readline
and gets
among more. Thee methods can be used with many optional arguments in order to perform position dependent and length dependent reading.
Read
Write
Working with Nmap files
Last updated