Author Topic: Streaming files to TrID (Unix pipeline etc.)  (Read 1496 times)

zacharyw

  • Newbie
  • *
  • Posts: 3
Streaming files to TrID (Unix pipeline etc.)
« on: September 20, 2021, 07:10:44 PM »
Hi Marco,

Is it possible to stream a file's contents to TrID for identification, rather than passing a file name?

For example, I can do something like this to pipe the trid binary to file:
Code: [Select]
user@ubuntu:~$ cat trid | file -
/dev/stdin: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.24, stripped

I tried using process substitution, as well as reading directly from stdin, but TrID does not accept these approaches:
Code: [Select]
user@ubuntu:~$ ./trid <(cat trid)
user@ubuntu:~$ cat trid | ./trid /dev/stdin
TrID/32 - File Identifier v2.24 - (C) 2003-16 By M.Pontello

* Error: found no file(s) to analyze!

Is this functionality supported? Thanks for the excellent tool. :)

Mark0

  • Administrator
  • Hero Member
  • *****
  • Posts: 2743
    • Mark0's Home Page
Re: Streaming files to TrID (Unix pipeline etc.)
« Reply #1 on: September 20, 2021, 10:36:07 PM »
Thx!
Not at the moment, but probably in a future version (can't say when).

zacharyw

  • Newbie
  • *
  • Posts: 3
Re: Streaming files to TrID (Unix pipeline etc.)
« Reply #2 on: September 21, 2021, 06:22:05 PM »
Thanks for the quick response. I work for a non-commercial organization, and this functionality would be very useful for us. If this could be done in a relatively straightforward manner (not sure how the code is presently architected), we would be interested in extending the code and sharing it back to you.

If this is something you would consider, we can discuss further over email? If not, I understand, and appreciate you taking the time to answer my questions.

Mark0

  • Administrator
  • Hero Member
  • *****
  • Posts: 2743
    • Mark0's Home Page
Re: Streaming files to TrID (Unix pipeline etc.)
« Reply #3 on: September 24, 2021, 03:25:07 PM »
Thanks, but for the time being, I'm not considering collaborations on TrID's development (aside from new filetypes definitions, of course).

zacharyw

  • Newbie
  • *
  • Posts: 3
Re: Streaming files to TrID (Unix pipeline etc.)
« Reply #4 on: September 27, 2021, 03:44:12 PM »
Okay thanks again for getting back to me. If you change your mind, the offer stands. We would not seek any ownership, and would be happy to sign an agreement saying that it is a free contribution to your project. Have a great day. :)