(Using sanette's python script) How does testdisk rename files and organize subdirectories?
Posted: 02 Jan 2019, 14:57
Hello,
after retrieving a lot of files from a image.dd created by tesdisk, I am trying to use sanette's python script to try to make sense among the retrieved files.
Photorec organized the saved files in subdirectories named from "recup_dir.1" to "recup_dir.58". The files are of various extentions such as .txt, .odt, .doc, .mp4, .mp3, .mov, and also some I know much less : .3gp and .m2ts, (video), and also others, sqlite, gz and so on…
the python script, automatically rename files after photorec, using the command line as
although not able to give back human readable to the files, except a very little number of them, interestingly saves the files in new directories by year, which could help the owner of the files get some organisation in the retrieved files.
Now I wonder this: If there aren't 2 or more files having the same name in different directories (ie : faaa111.jpg in recup_dir.1, recup_dir.3, recup_dir.37), then I could use the python script this way to merge files by year, this way:
after:
I will do:
then:
then
and so on until the last one:
then in the destination directory, _RECUP_DIR.2 the files would all be ordered by year?
For now, after processing this way for recup_dir.1 and recup_dir.2, here is what I find in the dest dir:
after retrieving a lot of files from a image.dd created by tesdisk, I am trying to use sanette's python script to try to make sense among the retrieved files.
Photorec organized the saved files in subdirectories named from "recup_dir.1" to "recup_dir.58". The files are of various extentions such as .txt, .odt, .doc, .mp4, .mp3, .mov, and also some I know much less : .3gp and .m2ts, (video), and also others, sqlite, gz and so on…
the python script, automatically rename files after photorec, using the command line as
Code: Select all
python ./rename_by_content.py --log log-renamebycontent.txt --output _RECUP_DIR.2 recup_dir.1/*
although not able to give back human readable to the files, except a very little number of them, interestingly saves the files in new directories by year, which could help the owner of the files get some organisation in the retrieved files.
Now I wonder this: If there aren't 2 or more files having the same name in different directories (ie : faaa111.jpg in recup_dir.1, recup_dir.3, recup_dir.37), then I could use the python script this way to merge files by year, this way:
after:
Code: Select all
python ./rename_by_content.py --log log-renamebycontent.txt --output _RECUP_DIR.2 recup_dir.1/*
I will do:
Code: Select all
python ./rename_by_content.py --log log-renamebycontent.txt --output _RECUP_DIR.2 recup_dir.2/*
then:
Code: Select all
python ./rename_by_content.py --log log-renamebycontent.txt --output _RECUP_DIR.2 recup_dir.3/*
then
Code: Select all
python ./rename_by_content.py --log log-renamebycontent.txt --output _RECUP_DIR.2 recup_dir.4/*
and so on until the last one:
Code: Select all
python ./rename_by_content.py --log log-renamebycontent.txt --output _RECUP_DIR.2 recup_dir.58/*
then in the destination directory, _RECUP_DIR.2 the files would all be ordered by year?
For now, after processing this way for recup_dir.1 and recup_dir.2, here is what I find in the dest dir:
and, for example, in the 2006 directory:$ ls -l
total 140
drwxrwxrwx 1 fluffy1 fluffy1 0 janv. 2 12:34 1900
drwxrwxrwx 1 fluffy1 fluffy1 0 janv. 2 12:43 2000
drwxrwxrwx 1 fluffy1 fluffy1 0 janv. 2 12:44 2006
drwxrwxrwx 1 fluffy1 fluffy1 0 janv. 2 12:44 2010
drwxrwxrwx 1 fluffy1 fluffy1 0 janv. 2 12:44 2011
drwxrwxrwx 1 fluffy1 fluffy1 4096 janv. 2 12:45 2012
drwxrwxrwx 1 fluffy1 fluffy1 4096 janv. 2 12:44 2013
drwxrwxrwx 1 fluffy1 fluffy1 0 janv. 2 12:44 2015
drwxrwxrwx 1 fluffy1 fluffy1 0 janv. 2 12:46 2016
drwxrwxrwx 1 fluffy1 fluffy1 0 janv. 2 12:42 2017
drwxrwxrwx 1 fluffy1 fluffy1 0 janv. 2 12:43 2018
drwxrwxrwx 1 fluffy1 fluffy1 135168 janv. 2 14:36 Unknown_year
This is my question : how has testdisk created the filenames? I mean : in each of the "recup_dir.*" directory, are all the files having different names, from one directory to the other? If I proceed as presented above, is there a risk that several files might bear the same name and overwrite some other file?$ ls -l 2006
total 0
drwxrwxrwx 1 fluffy1 fluffy1 0 janv. 2 12:44 Unknown_month
$ ls -l 2006/Unknown_month/
total 4
-rwxrwxrwx 1 fluffy1 fluffy1 1886 janv. 1 19:52 _rtf1_ansi_ansicpg1252_deff0_deflang1036_fonttbl_f0_fswiss_fcharset0_Arial_.rtf
$