I wasn't able to receive output from perror but I was able to figure out the solution.
Last week there was a Windows updated (unknown to me because it was not my computer) that put more restrictions on the C drive. My oldFileName was located in the C drive and because of those restrictions, it would not rename the file. I had to move the file location out of the C drive.