~ubuntu-branches/ubuntu/maverick/openturns/maverick

« back to all changes in this revision

Viewing changes to lib/src/Base/Common/Path.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2008-11-18 06:32:22 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20081118063222-pa0qncclrerrqkg2
Tags: 0.12.2-1
* New upstream release
* Bug fix: "New upstream release available (0.12.2)", thanks to Jerome
  Robert (Closes: #506005).
* Applied patch by J. Robert.
* debian/control: build-depends on libxml2

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21
21
 *
22
22
 *  @author: $LastChangedBy: dutka $
23
 
 *  @date:   $LastChangedDate: 2008-05-21 17:44:02 +0200 (mer, 21 mai 2008) $
24
 
 *  Id:      $Id: Path.cxx 818 2008-05-21 15:44:02Z dutka $
 
23
 *  @date:   $LastChangedDate: 2008-10-07 23:16:48 +0200 (mar 07 oct 2008) $
 
24
 *  Id:      $Id: Path.cxx 963 2008-10-07 21:16:48Z dutka $
25
25
 */
26
26
#include <vector>                 // for std::vector
27
27
#include <string>                 // for std::string
176
176
          directoryList.push_back(directory);
177
177
        } 
178
178
 
179
 
        // ... search in ${HOME}/openturns
 
179
        // ... search in ${HOME}/openturns/etc
180
180
        char * homeDirectory = getenv("HOME");
181
181
        if (homeDirectory) {
182
182
          FileName directory = homeDirectory;
202
202
      FileName Path::FindFileByNameInDirectoryList(const FileName & name, const DirectoryList & dirList)
203
203
        throw(FileNotFoundException)
204
204
      {
 
205
        if (name.size() == 0) throw FileNotFoundException(HERE) << "Can NOT find a file with no name";
 
206
 
205
207
        // If the name starts with a slash then it is an absolute path
206
208
        // and it did not need to be searched in the directory list
207
209
        // so we return it as is.
214
216
        for(currentDirectory  = dirList.begin();
215
217
            currentDirectory != dirList.end();
216
218
            currentDirectory++) {
217
 
          Log::Debug(OSS() << "DBG - Searching in directory : " << *currentDirectory);
 
219
          Log::Debug(OSS() << "Searching '" << name << "' in directory : " << *currentDirectory);
218
220
 
219
221
          fullPathForFile = *currentDirectory + "/" + name;
220
222
          struct stat fileStatBuffer;