Added print messages to track ftruncate error