completed directory and file functions