Collect a "file already exists" error.
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); }
See Implementation
Collect a "file already exists" error.