Add rm and strip abilities to atree.
The new line syntax is:
[SRC] [rm|strip] DEST
This allows one to write things like this in atree:
bin/src
bin/src bin/dest
bin/src "bin/another file name"
rm dest/file
rm dest/dir # recursive
strip bin/src
bin/src strip bin/dest
Src and dest can contain spaces if full enclosed in double-quotes.
The strip command can be overridden using the STRIP env var.
Change-Id: I22aae7a87c36c082e1aab87132099a3c644914da
diff --git a/tools/atree/files.h b/tools/atree/files.h
index 6480c98..f6bf8a6 100644
--- a/tools/atree/files.h
+++ b/tools/atree/files.h
@@ -8,8 +8,16 @@
using namespace std;
+enum FileOpType {
+ FILE_OP_COPY = 0,
+ FILE_OP_REMOVE,
+ FILE_OP_STRIP
+};
+
struct FileRecord
{
+ FileRecord();
+
string listFile;
int listLine;
@@ -18,9 +26,12 @@
string sourcePath;
bool sourceIsDir;
time_t sourceMod;
+ off_t sourceSize;
+ FileOpType fileOp;
string outName;
string outPath;
+ off_t outSize;
time_t outMod;
bool outIsDir;
unsigned int mode;