Filestate

I thought I already did this pull request. Apparently I did not.