MemoryFileSystem constructor

MemoryFileSystem(
  1. {FileSystemStyle style = FileSystemStyle.posix,
  2. void opHandle(
    1. String context,
    2. FileSystemOp operation
    ) = _defaultOpHandle}
)

Creates a new MemoryFileSystem.

The file system will be empty, and the current directory will be the root directory.

The clock will be a real-time clock; file modification times will reflect the real time as reported by the operating system.

If style is specified, the file system will use the specified path style. The default is FileSystemStyle.posix.

Implementation

factory MemoryFileSystem({
  FileSystemStyle style = FileSystemStyle.posix,
  void Function(String context, FileSystemOp operation) opHandle =
      _defaultOpHandle,
}) =>
    _MemoryFileSystem(
      style: style,
      clock: const Clock.realTime(),
      opHandle: opHandle,
    );