diff --git a/DEDISgen.c b/DEDISgen.c index d77683a..56dac83 100644 --- a/DEDISgen.c +++ b/DEDISgen.c @@ -416,6 +416,14 @@ int main (int argc, char *argv[]){ strcpy(duplicatedbpath,DUPLICATEDB); } + char mkcmd[200]; + sprintf(mkcmd, "mkdir -p %s", printdbpath); + int ress = system(mkcmd); + sprintf(mkcmd, "mkdir -p %s", duplicatedbpath); + ress=system(mkcmd); + if(ress<0) + perror("Error creating folders for databases\n"); + printf("Removing old databases\n"); //remove databases if exist diff --git a/README b/README index 31ac6ce..113f04c 100644 --- a/README +++ b/README @@ -148,6 +148,7 @@ Running the generator DEDISgen: -p (Path for the folder or disk device) -o (Path for the output distribution file. This is only necessary if distribution file of duplicates is going to be generated) + (Please specifiy the full path including the distribution file name to be generated) Optional Parameters @@ -160,11 +161,11 @@ Running the generator DEDISgen: Examples -//generate duplicate distribution for files in folder /dir/duplicates/ and its subfolders -./DEDISgen -f -p/dir/duplicates/ +//generate duplicate distribution file /dir/dist_file for files in folder /dir/duplicates/ and its subfolders +./DEDISgen -f -p/dir/duplicates/ -o/dir/dist_file -//generate duplicate distribution for device /path/device. Use a block size of 8192 Bytes (8KB) -./DEDISgen -d -p/path/device -b8192 +//generate duplicate distribution file /dir/dist_file for device /path/device. Use a block size of 8192 Bytes (8KB) +./DEDISgen -d -p/path/device -b8192 -o/dir/dist_file Deduplication distribution FILE: diff --git a/README.mkd b/README.mkd index 7ce45cb..aefcdc9 100644 --- a/README.mkd +++ b/README.mkd @@ -139,7 +139,7 @@ run 8 minutes mixed benchmark with a nominal load (100reads/s and 50 writes/s) i -p Path for the folder or disk device - -o Path for the output distribution file. This is only necessary if distribution file of duplicates is going to be generated + -o Path for the output distribution file (Please specifiy the full path including the distribution file name to be generated). This is only necessary if distribution file of duplicates is going to be generated Optional Parameters @@ -152,13 +152,13 @@ run 8 minutes mixed benchmark with a nominal load (100reads/s and 50 writes/s) i # Examples -generate duplicate distribution for files in folder /dir/duplicates/ and its subfolders +generate duplicate distribution file /dir/dist_file for files in folder /dir/duplicates/ and its subfolders -./DEDISgen -f -p/dir/duplicates/ +./DEDISgen -f -p/dir/duplicates/ -o/dir/dist_file -generate duplicate distribution for device /path/device. Use a block size of 8192 Bytes (8KB) +generate duplicate distribution file /dir/dist_file for device /path/device. Use a block size of 8192 Bytes (8KB) -./DEDISgen -d -p/path/device -b8192 +./DEDISgen -d -p/path/device -b8192 -o/dir/dist_file # Deduplication distribution FILE: