add function to convert access flags to legacy open mode