generalized file opening
almost working?