fs: implement infrastructure for an 'exists' function