Recent Posts

How to Read a file in PHP

less than 1 minute read

Reading a whole file is as easy as one function call in PHP. (Especially good if you want to read a small file, and want all the data in memory anyway).

How to Read from stdin in C

less than 1 minute read

Reading from stdin in c - is exactly like reading from a file. (In unix philosophy - everything is a file after all). This means that the how to read a file ...

How to Read from stdin in Go

less than 1 minute read

Reading from stdin in go is as easy as reading from os.Stdin - the ioutil.ReadAll method reads all bytes into a buffer and allows you to handle the input onc...

How to Read a file in Ruby

less than 1 minute read

In ruby you read a file in two steps. First open the file, and then iterate over the contents. (In this instance we loop over the contents of a text file so ...

How to Read a file in C

less than 1 minute read

Reading files in C is very easy. First you need the stdio.h header file included, then you need a pointer of type FILE, and you call fopen on a filename (set...