fixed broken stat, made _fstat accept NULL pointer.
fixed broken rename.
added localtime.