]> git.tdb.fi Git - builder.git/blobdiff - source/copy.cpp
Migrate from msppath to mspfs
[builder.git] / source / copy.cpp
index bdcd0a94a8006ec108c31ecfbea5e3ce7d4d97bc..f8c581bd5664ca123f4f657da77883c7dff1003b 100644 (file)
@@ -8,7 +8,9 @@ Distributed under the LGPL
 #include <errno.h>
 #include <fstream>
 #include <iostream>
-#include <msp/path/utils.h>
+#include <msp/fs/dir.h>
+#include <msp/fs/stat.h>
+#include <msp/fs/utils.h>
 #include "builder.h"
 #include "copy.h"
 #include "package.h"
@@ -16,7 +18,7 @@ Distributed under the LGPL
 using namespace std;
 using namespace Msp;
 
-Copy::Copy(Builder &b, const Package &pkg, const Path &s, const Path &d):
+Copy::Copy(Builder &b, const Package &pkg, const FS::Path &s, const FS::Path &d):
        InternalAction(b),
        src(s),
        dest(d)
@@ -38,7 +40,7 @@ Copy::Worker::Worker(Copy &c):
 
 void Copy::Worker::main()
 {
-       mkpath(copy.dest.subpath(0, copy.dest.size()-1), 0755);
+       FS::mkpath(FS::dirname(copy.dest), 0755);
 
        try
        {
@@ -80,7 +82,7 @@ void Copy::Worker::main()
        }
 
        // Preserve file permissions
-       struct stat st=stat(copy.src);
+       struct stat st=FS::stat(copy.src);
        chmod(copy.dest.str().c_str(), st.st_mode&0777);
 
        done=true;