this snippet let's you insert data at the beginning of a file.
it reads the contents and adds new data to the first line of the file.
after this it joins the lines and writes them back to the file again.

copy the code of file handling / write to first line of file

click here to select all the code