Table of Contents

Paths and files

Work with normalized paths, files, archives, and temporary directories.

Entry points

Do.ApplicationData

Gets the current user's roaming application-data directory without checking its existence.

public static AbsolutePath ApplicationData { get; }

Property Value

AbsolutePath

Exceptions

DirectoryNotFoundException

The platform does not provide the directory.

Do.Documents

Gets the current user's documents directory without checking its existence.

public static AbsolutePath Documents { get; }

Property Value

AbsolutePath

Exceptions

DirectoryNotFoundException

The platform does not provide the directory.

Do.LocalApplicationData

Gets the current user's local application-data directory without checking its existence.

public static AbsolutePath LocalApplicationData { get; }

Property Value

AbsolutePath

Exceptions

DirectoryNotFoundException

The platform does not provide the directory.

Do.ProgramFiles

Gets the platform's program-files directory without checking its existence.

public static AbsolutePath ProgramFiles { get; }

Property Value

AbsolutePath

Exceptions

DirectoryNotFoundException

The platform does not provide the directory.

Do.ProgramFilesX86

Gets the platform's 32-bit program-files directory without checking its existence.

public static AbsolutePath ProgramFilesX86 { get; }

Property Value

AbsolutePath

Exceptions

DirectoryNotFoundException

The platform does not provide the directory.

Do.UserProfile

Gets the current user's profile directory without checking its existence.

public static AbsolutePath UserProfile { get; }

Property Value

AbsolutePath

Exceptions

DirectoryNotFoundException

The platform does not provide the directory.

Do.CreateTempDirectory(string?)

Creates a uniquely named directory under the platform's temporary directory.

public static AbsolutePath CreateTempDirectory(string? prefix = null)

Parameters

prefix string?

An optional filename-safe prefix. Directory separators and invalid filename characters are rejected.

Returns

AbsolutePath

Do.CreateTempFile(string?, string)

Creates a uniquely named empty file under the platform's temporary directory.

public static AbsolutePath CreateTempFile(string? prefix = null, string extension = ".tmp")

Parameters

prefix string?

An optional filename-safe prefix. Directory separators and invalid filename characters are rejected.

extension string

A file extension of at least two characters, including its leading .; separators and invalid filename characters are rejected.

Returns

AbsolutePath

Related types