collectFileExistsError

Collect a "file already exists" error.

alias collectFileExistsError = collectOSError!(errno => errno == core.stdc.errno.EEXIST,
(
code
)
)

Examples

auto fn = deleteme;
foreach (dg; [
	{ mkdir(fn); },
	{ openFile(fn, "wxb"); },
	{ touch(fn ~ "2"); hardLink(fn ~ "2", fn); },
])
{
	if (fn.exists) fn.removeRecurse();
	assert( dg.collectFileExistsError);
	assert(!dg.collectFileExistsError);
}

Meta