Table of Contents

Class DirectoryBuilder

Namespace
ZeroInstall.Store.FileSystem
Assembly
ZeroInstall.Store.dll

Builds a file system directory on-disk.

public class DirectoryBuilder : MarshalNoTimeout, IBuilder, IForwardOnlyBuilder
Inheritance
DirectoryBuilder
Implements
Inherited Members
Extension Methods

Constructors

DirectoryBuilder(string, IBuilder?)

Builds a file system directory on-disk.

public DirectoryBuilder(string path, IBuilder? innerBuilder = null)

Parameters

path string

The path to the directory to build the implementation in.

innerBuilder IBuilder

An additional IBuilder to pass all calls on to as well. Usually ManifestBuilder.

Properties

AllowedHardlinkRoot

A directory all hardlink targets must be a child of. Defaults to Path.

public string AllowedHardlinkRoot { get; init; }

Property Value

string

Path

The path to the directory to build the implementation in.

public string Path { get; }

Property Value

string

Methods

AddDirectory(string)

Adds a subdirectory to the implementation.

public void AddDirectory(string path)

Parameters

path string

The path of the directory to create relative to the implementation root.

Exceptions

UnauthorizedAccessException

Access to a resource was denied.

IOException

An IO operation failed.

AddFile(string, Stream, UnixTime, bool)

Adds a file to the implementation.

public void AddFile(string path, Stream stream, UnixTime modifiedTime, bool executable = false)

Parameters

path string

The path of the file to create relative to the implementation root.

stream Stream

The contents of the file.

modifiedTime UnixTime

The last write time to set for the file.

executable bool

true if the file's executable bit is to be set; false otherwise.

Exceptions

UnauthorizedAccessException

Access to a resource was denied.

IOException

An IO operation failed.

Adds a hardlink to the implementation.

public void AddHardlink(string path, string target, bool executable = false)

Parameters

path string

The path of the hardlink to create relative to the implementation root.

target string

The path of the existing file the hardlink shall be based on relative to the implementation root. Must point

executable bool

true if the executable bit of the hardlink is set; false otherwise.

Exceptions

UnauthorizedAccessException

Access to a resource was denied.

IOException

An IO operation failed.

NotSupportedException

The currently platform or builder does not support hardlinks. Use AddFile(string, Stream, UnixTime, bool) instead.

Adds a symbolic link to the implementation.

public void AddSymlink(string path, string target)

Parameters

path string

The path of the symlink to create relative to the implementation root.

target string

The target the symbolic link shall point to relative to path. May use non-native path separators.

Exceptions

UnauthorizedAccessException

Access to a resource was denied.

IOException

An IO operation failed.

MarkAsExecutable(string)

Marks a previously added file as executable.

public void MarkAsExecutable(string path)

Parameters

path string

The path of the file to create relative to the implementation root.

Exceptions

UnauthorizedAccessException

Access to a resource was denied.

IOException

An IO operation failed.

Remove(string)

Removes a file or directory from the implementation.

public void Remove(string path)

Parameters

path string

The path of the file or directory relative to the implementation root.

Exceptions

UnauthorizedAccessException

Access to a resource was denied.

IOException

An IO operation failed.

Rename(string, string)

Renames a file or directory in the implementation.

public void Rename(string path, string target)

Parameters

path string

The original path of the file or directory relative to the implementation root.

target string

The new path of the file or directory relative to the implementation root.

Exceptions

UnauthorizedAccessException

Access to a resource was denied.

IOException

An IO operation failed.

Turns a previously added file into a symlink.

public void TurnIntoSymlink(string path)

Parameters

path string

The path of the symlink to create relative to the implementation root.

Exceptions

UnauthorizedAccessException

Access to a resource was denied.

IOException

An IO operation failed.