Top index Wirbel home

fs::read

file.read() - read contents of a file
file.read(int) - read part of a file

file.read() reads the complete content of a file binary safe into memory and returns it as one string. If parts of the file already have been read then only the rest of the file is being read.

file.read(int) binary safe reads a specified number of bytes from an open file. If end of file is reached the number of read bytes might be less then specified. This is not assumed to be an error. Also on special files like pipes or sockets the read might return less bytes without being at end of file.