}
checkOneFile("x1.txt", "dir1_2_1", hashPath);
checkOneFile("x2.txt", "dir1_2_1", hashPath);
- bool changed1 = listChanged.find("x1.txt") != (size_t) -1;
- bool changed2 = listChanged.find("x2.txt") != (size_t) -1;
+ bool changed1 = listChanged.find("x1.txt") != (ReSeqArray::Index) -1;
+ bool changed2 = listChanged.find("x2.txt") != (ReSeqArray::Index) -1;
checkT(changed1 != changed2);
checkOneFile("dir1_2_1", "dir1_2", hashPath);
checkT(listChanged.find("dir1_2_1") >= 0);
checkOneFile("dir1_1", "dir1", hashPath);
checkOneFile("dir1_2", "dir1", hashPath);
- changed1 = listChanged.find("dir1_1") != (size_t) -1;
- changed2 = listChanged.find("dir1_2") != (size_t) -1;
+ changed1 = listChanged.find("dir1_1") != (ReSeqArray::Index) -1;
+ changed2 = listChanged.find("dir1_2") != (ReSeqArray::Index) -1;
checkT(changed1 != changed2);
checkF(hashPath.get("cache.txt", buffer));
}
LC_COMPARE_DIR_1, // 50122\r
LC_DELETE_1, // 50123\r
};\r
-const char* ReDirTools::m_version = "2015.02.25";\r
+const char* ReDirTools::m_version = "2015.03.04";\r
ReLogger* ReDirTools::m_logger = NULL;\r
\r
static const char* s_helpSummary[] = { "dirtool or dt <command> <opts>",\r
"delete delete the selected files",\r
"help shows info about the arguments/options",\r
"list shows the meta data of the selected files",\r
+ "random displays random numbers",\r
"statistic shows statistics about a direcctory tree",\r
"synchronize copies only modified or new files from",\r
" from a source directory tre to a target",\r
const char* s_randomExamples[] = { "dirtool ra --multiple -w3 10 33",\r
"dirtool rand -s 6 49",\r
"dirtool rand --sort --width=1 5 50",\r
+ "dirtool rand --sort --width=1 2 10",\r
NULL };\r
\r
static const char* s_statisticUsage[] =\r
digest2.update(line);\r
fprintf(fp, "%s\n", line.str());\r
if (m_verboseLevel >= V_NORMAL)\r
- fprintf(m_output, "%16s\t\%s",\r
+ fprintf(m_output, "%16s\t%s",\r
entry->isDirectory() ? "" : m_digest->hexDigest().str(),\r
entry->fullName());\r
}\r
if (m_verboseLevel >= V_NORMAL){\r
fprintf(m_output, "%s\n", name);\r
}\r
- if (unlink(name) != 0)\r
+ if (_unlink(name) != 0)\r
m_logger->sayF(LOG_ERROR | CAT_FILE, LC_DELETE_1,\r
i18n("cannot delete ($1): $2")).arg(errno).arg(name).end();\r
}\r
from = atol(m_programArgs.getArg(2));\r
ReShiftRandom rand;\r
rand.setSeed(rand.nearTrueRandom());\r
+ for (int ii = rand.nextInt(100); ii > 0; ii--)\r
+ rand.nextInt();\r
int factor = to <= 1000 ? 1000 * 1000 : 1;\r
int numbersPerLine = m_programArgs.getInt("perline");\r
int width = m_programArgs.getInt("width");\r
if (! multiple && count >= to - from + 1)\r
help(i18n("not realy random: all possible values requested. Do you mean '--multiple'?"));\r
while(found < count){\r
- value.setLength(0).appendInt(rand.nextInt(from * factor, to * factor)\r
- / factor, "%010d");\r
+ value.setLength(0).appendInt(from + rand.nextInt((to - from + 1) * factor) / factor, "%010d");\r
int ix = (int) values.find(value.str());\r
if (! multiple && ix != -1)\r
continue;\r