Refactored filesystem operation dispatch to get rid of the extra function for OS X