D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3570 - mkdirRecurse throws exception on trailing empty directory
Summary: mkdirRecurse throws exception on trailing empty directory
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other All
: P2 normal
Assignee: Shin Fujishiro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-03 16:51 UTC by Jesse Phillips
Modified: 2015-06-09 01:27 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jesse Phillips 2009-12-03 16:51:34 UTC
If the directory passed to mkdirRecurse ends with a backslash then an exception when the path provided ends with a backslash.

std.file.FileException: C:\fake\here\: Cannot create a file when that file already exists.

import std.file;

void main() {
	auto dir = "C:\\fake\\here\\";

	mkdirRecurse(dir);
}

The directories are correctly created. The code below works without throwing an exception.

import std.file;

void main() {
	auto dir = "C:\\fake\\here";

	mkdirRecurse(dir);
}
Comment 1 Shin Fujishiro 2010-10-15 10:55:24 UTC
Fixed in the svn trunk r2104.