more generalized file accessor