Added overwrite flag

Currently if the file exists there is no way to overwrite it even if it is really necessary.
So I have added a flag to force the overwrite of the file