boost::filesystem



  • Ich kapiere das so langsam nicht mehr. Ich habe nach längerer Zeit es endlich geschafft daß ich mit Boost für C++ programmieren kann.

    Nun habe ich folgendes probiert:

    #include "boost/filesystem/operations.hpp"
    #include "boost/filesystem/path.hpp"
    #include <iostream>
    using namespace boost::filesystem;
    using namespace std;
    
    main()
    {
      path my_path("/root/office52");
      if (exists(my_path))
      {
        cout << "Verzeichnis vorhanden" << endl;
      }
    }
    

    So weit so gut, das alles klappt schonmal.
    Wenn ich aber statt dem Pfad

    /root/office52
    

    den Pfad

    /root/.kde
    

    verwende, bricht das Programm schon bei der Initialisierung-Deklaration ab, also bei

    path my_path("/root/.kde");
    

    Meiner Meinung nach ist der . im Verzeichnisnamen schuld.

    Kann mir jemand weiterhelfen, für jede Antwort bin ich dankbar, thx.


Anmelden zum Antworten