POSIX compliance in filenames

clock function implemented. Trim trailing spaces in filenames for POSIX
systems.