avoid using sys/stat.h in optimizer