Do we really need another function to do this? Why just not use the standard one instead of one trying to do many things (including checking for file to be rotated)