make external attributes generation for unix filemode more robust.