Cross platform guessWidth()

1. guessWidth() function with stub for non-unix platforms.
2. Correct handling of non-existing files and directories