write links to file