first draft of file role with encoding support