Added enum for file control rather than just an int