X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcopy.cpp;h=f8c581bd5664ca123f4f657da77883c7dff1003b;hb=a2adbd9c0a8d7a7567848c4c6bdbf0de6ba32bb1;hp=bdcd0a94a8006ec108c31ecfbea5e3ce7d4d97bc;hpb=7567502e17be7704d58ced2f49703fcf71c7ef38;p=builder.git diff --git a/source/copy.cpp b/source/copy.cpp index bdcd0a9..f8c581b 100644 --- a/source/copy.cpp +++ b/source/copy.cpp @@ -8,7 +8,9 @@ Distributed under the LGPL #include #include #include -#include +#include +#include +#include #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;