changed boolean arguments from individual arguments to flag object, changed create dir and file functions to get and create functions