-1

I want to find out the filetypes of some files with no file ending. enter image description here

The best case would be if I could get the same string you get in the file properties. Iam using Python and already tried with mimetypes, which doesn't worked.

Thanks for any help :)

Kong Konfus
  • 57
  • 1
  • 5
  • Does this answer your question? [How to check type of files without extensions?](https://stackoverflow.com/questions/10937350/how-to-check-type-of-files-without-extensions) – sappjw Jan 06 '23 at 19:38

2 Answers2

1

I think your question has been resolved in this issue on stackoverflow :

check type of file without extensions

hopes this help :)

Clém
  • 76
  • 4
  • 2
    If you believe the question is a duplicate, mark it as such, rather than answering it. Click "close", select "duplicate", and enter the URL of the duplicate question. – Tom Karzes Aug 06 '21 at 12:49
  • Hello Tom, i'm starting SO so that's a nice advise, but i can't seem to find the `close` button, maybe i do not have the right – Clém Aug 06 '21 at 13:29
  • It's directly below the question, to the left of the author box. There are links to "Share", "Edit", "Follow", "Close", and "Flag". Click "Close", then select "Duplicate" and enter the duplicate URL. I'm not sure if some amount of reputation is needed to unlock it, but it's quite possible. – Tom Karzes Aug 06 '21 at 13:37
  • Yes it is indeed linked to reputation, i can see the 4 others button but not the close one, but i'll be sure to do it when i'll be allowed to on further questions :) – Clém Aug 06 '21 at 14:40
  • 1
    It looks like you need 3000 rep. to be able to cast close/reopen votes. You can read about it [here](https://stackoverflow.com/help/privileges/close-questions). – Tom Karzes Aug 06 '21 at 14:50
0

You can try using the file command, executed via subprocess.

result = subprocess.check_output(['file', '/path/to/allcfgconv'])

The resulting string is a bit verbose; you'll have to parse the file type from it yourself.

chepner
  • 497,756
  • 71
  • 530
  • 681