addFile() fixes

- fix time to string conversion to be cross platform (possible crash fix on linux)
- terminate strings with NULL char