ChrootFileSystem constructor

ChrootFileSystem(
  1. FileSystem delegate,
  2. String root
)

Creates a new file system backed by root path in delegate file system.

NOTE: root must be a canonicalized path; see p.canonicalize.

Implementation

ChrootFileSystem(this.delegate, this.root) {
  if (root != delegate.path.canonicalize(root)) {
    throw ArgumentError.value(root, 'root', 'Must be canonical path');
  }
  _cwd = _localRoot;
}