openMmapFileSync function

MmapFile openMmapFileSync(
  1. String path, {
  2. bool create = true,
  3. bool readOnly = false,
  4. bool direct = false,
  5. bool largePages = false,
  6. bool mmapCache = true,
})

Synchronous open.

Implementation

MmapFile openMmapFileSync(
  String path, {
  bool create = true,
  bool readOnly = false,
  bool direct = false,
  bool largePages = false,
  bool mmapCache = true,
}) {
  if (Platform.isWindows) {
    return WindowsMmapFile.openSync(
      path,
      create: create,
      readOnly: readOnly,
      direct: direct,
      largePages: largePages,
      mmapCache: mmapCache,
    );
  }
  if (largePages) {
    throw UnsupportedError('large pages are only implemented on Windows');
  }
  return PosixMmapFile.openSync(
    path,
    create: create,
    readOnly: readOnly,
    direct: direct,
    mmapCache: mmapCache,
  );
}