glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [glob2-devel] Strange thing in FileManager


From: Stéphane Magnenat
Subject: Re: [glob2-devel] Strange thing in FileManager
Date: Wed, 26 Apr 2006 14:12:51 +0200
User-agent: KMail/1.9.1

On Wednesday 26 April 2006 11:28, Sébastien wrote:
> I found something strange :
>       void FileManager::addWriteSubdir(const std::string &subdir)
>       {
>               for (size_t i = 0; i < dirList.size(); i++)
>               {
>                       std::string toCreate(dirList[i]);
>                       toCreate += '/';
>                       toCreate += subdir;
>                       #ifdef WIN32
>                       int result = _mkdir(toCreate.c_str());
>                       #else
>                       int result = mkdir(toCreate.c_str(), S_IRWXU);
>                       #endif
>                       // NOTE : We only want to create the subdir for the 
> first index
>       //              if (result==0)
>                               break;
>                       if ((result==-1) && (errno==EEXIST))
>                               break;
>               }
>       }
> Note the if(result==0) is commented so we always make a break and so we
> never do more than one loop... Am I wrong ?

Well, the comment is coherent with the code. But it's not added it (nor did 
the change).

Steph




reply via email to

[Prev in Thread] Current Thread [Next in Thread]