Changeset 796 for trunk/lib/utility.cc


Ignore:
Timestamp:
Jul 1, 2009, 2:55:02 AM (12 years ago)
Author:
Peter Johansson
Message:

added a function mkdir_p(1)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/utility.cc

    r795 r796  
    33/*
    44  Copyright (C) 2006, 2007, 2009 Jari Häkkinen, Peter Johansson
    5   Copyright (C) 2008 Peter Johansson
     5  Copyright (C) 2008, 2009 Peter Johansson
    66
    77  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    186186
    187187
     188  void mkdir_p(const std::string& dir)
     189  {
     190    std::string mother = directory_name(dir);
     191    if (!node_exist(mother))
     192      mkdir_p(mother);
     193    if (!node_exist(dir))
     194      mkdir(dir);
     195  }
     196
     197
    188198  bool node_exist(const std::string& path)
    189199  {
Note: See TracChangeset for help on using the changeset viewer.