Seems ForceDirectories does not create all subdirectories if we have two slashes between dirnames. Happens when the user appends a slash to the end of the output directory.

This commit is contained in:
Ansgar Becker
2010-02-13 07:23:30 +00:00
parent c95ae5fa10
commit b8477602fd

View File

@ -971,10 +971,13 @@ begin
StartTime := GetTickCount;
if ToDir then begin
FreeAndNil(ExportStream);
DbDir := comboExportOutputTarget.Text + '\' + DBObj.Database;
DbDir := comboExportOutputTarget.Text;
if DbDir[Length(DbDir)] <> '\' then
DbDir := DbDir + '\';
DbDir := DbDir + DBObj.Database + '\';
if not DirectoryExists(DbDir) then
ForceDirectories(DbDir);
ExportStream := TFileStream.Create(DbDir+'\'+DBObj.Name+'.sql', fmCreate or fmOpenWrite);
ExportStream := TFileStream.Create(DbDir + DBObj.Name+'.sql', fmCreate or fmOpenWrite);
end;
if ToFile and (not Assigned(ExportStream)) then
ExportStream := TFileStream.Create(comboExportOutputTarget.Text, fmCreate or fmOpenWrite);