file/directory masks were the wrong way round. oops.