open function
Implementation
int open(String path, int flags, int mode) {
final cPath = path.toNativeUtf8(allocator: malloc);
final result = _open(cPath, flags, mode);
malloc.free(cPath);
if (result < 0) {
throw Exception('open : ${lastError()} : $path');
}
return result;
}