#define MEDIA_EXCLUSION_LIST "temp_video/Camera/DCIM:mp3|mpga|m4a|mp4|wav|amr|awb|wma|ogg|oga|aac|mka|flac|3gp|3ga|mid|midi|xmf|rtttl|rtx|ota|smf|spm|imy|mpeg|m4v|3gp|3gpp|3g2|3gpp2|wmv|asf|mkv|webm|ts|avi|jpg|jpeg|gif|png|bmp|wbmp|divx|flv|ac3|mov|tiff|f4v|mpeg3|voice"
#define CIPHER_MODE "aes"
-#define ENCRYPTION_CHECKER_NAME ".ecryptfs_encrypted"
+#define ENCRYPTION_TMP_DIR ".ecryptfs_encrypted"
#define ECRYPTFS_VERSION_MAJOR 0x00
try {
unsigned long long totalSize = getAvailableSpace(source), current;
- runtime::File tempDir(destination + "/" ENCRYPTION_CHECKER_NAME);
+ runtime::File tempDir(destination + "/" ENCRYPTION_TMP_DIR);
+
+ if (tempDir.exists()) {
+ tempDir.remove(true);
+ }
tempDir.makeDirectory();
if (!(options & OPTION_ONLY_NEW_FILE)) {
try {
unsigned long long totalSize = getAvailableSpace(source), current;
- runtime::File tempDir(source + "/" ENCRYPTION_CHECKER_NAME);
+ runtime::File tempDir(source + "/" ENCRYPTION_TMP_DIR);
runtime::File tempMountpoint(tempDir.getPath() + "/mount");
+ tempDir.makeDirectory();
+
tempMountpoint.makeDirectory();
ecryptfsMount(source, tempMountpoint.getPath(), key, 0);