Refactoring the open for linux