fromFile implementation