read-a-file

How to Read a File in C#

less than 1 minute read

Csharp was probably the first compiled language I really loved. When the first version of .net came out I wrote a small CMS using C# and the new runtime. (A ...

How to read a file in Java

less than 1 minute read

Java is - off course you might joke - rather verbose when it comes to reading files. However most of the verbosity has to do with importing the functionality...

How to Read a file in JavaScript

less than 1 minute read

Reading a file in Javascript (again, nodejs) is as easy as using the built-in method fs.readFile (however it needs to be required first).

How to Read a file in Go

less than 1 minute read

In go you will sometimes write more code than you are used to in e.g. most higher level languages (think php, ruby, python) - but will have a lot more contro...

How to Read a file in Elixir

less than 1 minute read

Reading files in elixir is pretty straight forward - especially if you just want the content of a file you know exists. And that case it is a oneliner just l...

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 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...