added realpath function to print out the absolte path of a file