Now writes to an explicit fileID - otherwise we may run out of IDs.