css support

Using PhotoRec to recover lost data
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Post Reply
Message
Author
qdinar
Posts: 5
Joined: 29 Jul 2023, 18:01

css support

#1 Post by qdinar »

i looked some recovered txt files and saw they are css files. could you add ability to detect css files? maybe by just some keywords, maybe by whole validity check?

recuperation
Posts: 2737
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: css support

#2 Post by recuperation »

qdinar wrote: 29 Jul 2023, 23:47 i looked some recovered txt files and saw they are css files. could you add ability to detect css files? maybe by just some keywords, maybe by whole validity check?
There are lots of files types that contain readable text that are classified as txt-files because they are missing distinct fingerprints.
"just some keywords" does not meet any acceptable quality standard.

As for programming a "validity check" you can contribute your code (something the author of Photorec would really appreciate!) or hire a programmer. To give you an idea of the extent of programming this read the CSS documentation, p.e. here:

https://www.w3schools.com/css/css_howto.asp

I guess nobody is interested in CSS files anyway. You just want them to be recognized to simplify your life.

Try to use the search capabilities of your operating system to filter the files you don't want to see.

gianfrus
Posts: 3
Joined: 07 Jan 2024, 16:59

Re: css support

#3 Post by gianfrus »

Hi! Just for info in the case of a hypotetical future improving of text/code recognition:
Christian Weiske (cweiske) on GitHub made an extension for the MIME magic file: https://github.com/cweiske/MIME_Type_PlainDetect

recuperation
Posts: 2737
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: css support

#4 Post by recuperation »

There is no real usable recognition in his example.
I do not understand the php-language but I see that

Code: Select all

   $type = $mt->autoDetect($file)
his code relies on the autoDetect-function of a new mime-type.

There is no mime-type "class" in C and no autoDetect-function.
To make this example usable the source coude of the autoDetect-function needs to be translated to C.

gianfrus
Posts: 3
Joined: 07 Jan 2024, 16:59

Re: css support

#5 Post by gianfrus »

Ok, just to tak about it.
I made the assumption that Photorec works similar to the GNU/Linux 'file' command in recognize file's content, but it's probably wrong.
Indeed, the "MIME magic file extension" from C.Weiske can be used with the 'file' command, other than only PHP:

Code: Select all

file -m programming.magic /path/to/file.css
and the 'file' command is written in C (https://darwinsys.com/file).
The problem I see is that 'file' command recognize file content but it doesn't care about uniquely associating a file name extension.

recuperation
Posts: 2737
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: css support

#6 Post by recuperation »

TestDisk is working on different platforms:

https://www.cgsecurity.org/wiki/TestDisk_Download

Issuing a shell command that only works on a linux system will not help on the other platforms.
What's needed is C code or a C-library that can be used without license problems.

Post Reply