dbuild.util

Members

Functions

lockFile
auto lockFile(string path, Duration timeout = dur!"msecs"(500))

Obtain a lock for a file at the given path. If the file cannot be locked within the given duration, an exception is thrown. The file will be created if it does not yet exist. Deleting the file is not safe as another process could create a new file with the same name. The returned lock will get unlocked upon destruction.

searchInEnvPath
string searchInEnvPath(in string envPath, in string filename, in char sep = envPathSep)

Search for filename in the envPath variable content which can contain multiple paths separated with sep depending on platform.

tempFilePath
string tempFilePath(string fnFmt)

return the path of a file in a temp dir location with a unique name. fnFmt should be a file name (without directory) containing "%s" for use with std.format. It is used to insert a unique random string in the path.

Manifest constants

envPathSep
enum envPathSep;

environment variable path separator

Meta