[FIXED] DirectoryCreator.cs -

Posts   
 
    
bertcord avatar
bertcord
User
Posts: 206
Joined: 01-Dec-2003
# Posted on: 08-Apr-2004 00:14:35   

On line 147 of DirectoryCreator.cs

    DirectoryInfo targetDirectory = null;
            if(!alreadyExists)
            {
                // create it
                targetDirectory = Directory.CreateDirectory(fullPath);
                base.LogLine("Directory '" + fullPath + "' created.", "DirectoryCreator", true, true);
            }
            else
            {
                if(clearWhenExistent)
                {
                    targetDirectory.Delete(true);
                    base.LogLine("Directory '" + fullPath + "' and contents deleted.", "DirectoryCreator", true, true);
                }
                        
                // re create it
                targetDirectory = Directory.CreateDirectory(fullPath);
                base.LogLine("Directory '" + fullPath + "' created/preserved.", "DirectoryCreator", true, true);
            }

This section will rasie an error as targetDirectory is never set

 if(clearWhenExistent)
                {
                    targetDirectory.Delete(true);
                    base.LogLine("Directory '" + fullPath + "' and contents deleted.", "DirectoryCreator", true, true);
                }

change to

if(clearWhenExistent)
                {
                    targetDirectory = new DirectoryInfo(fullPath);
                    targetDirectory.Delete(true);
                    base.LogLine("Directory '" + fullPath + "' and contents deleted.", "DirectoryCreator", true, true);
                } 
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39880
Joined: 17-Aug-2003
# Posted on: 08-Apr-2004 09:28:58   

This is fixed already, I've changed it in the new SDK.

(I now call Directory.Delete(fullPath, true) simple_smile )

Frans Bouma | Lead developer LLBLGen Pro
bertcord avatar
bertcord
User
Posts: 206
Joined: 01-Dec-2003
# Posted on: 08-Apr-2004 17:57:51   

Otis wrote:

This is fixed already, I've changed it in the new SDK.

(I now call Directory.Delete(fullPath, true) simple_smile )

damn ... and I was all proud of myself cry

I have 4 machines and sometimes I forget what machine I downloaded the latest updates to hahah

kewl

I will keep looking maybe i iwll find another bug I can help you out with stuck_out_tongue_winking_eye

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39880
Joined: 17-Aug-2003
# Posted on: 08-Apr-2004 20:49:40   

stuck_out_tongue_winking_eye

I stumbled upon this bug myself a couple of weeks ago, before I updated the SDK. Let's say, "untested area" came close to describe that code section wink

Frans Bouma | Lead developer LLBLGen Pro