Fixed file attribute call on windows; hopefully

This code is not very nice looking right now