fixes long filenames

The problem is that the file system fails to write new files if the name is too long.  In this case we generate the hash of the longer name and write out a file with the hash as the name instead.  Assigning to @girving