File "type"

David Dick drd at siia.mv.com
Fri Sep 28 00:49:13 AEST 1990


In <171 at alchemy.UUCP> bbs at alchemy.UUCP (BBS Administration) writes:


>	Could someone explain how the command "file" works? Specifically, I am
>writing a program that allows users to navigate their $HOME directory and
>any subdirectories (they cannot leave their $HOME directory though, for
>security reasons) to find files that are to be read into a text editor.
>Some text editor forks this program, and when the user selects a file to
>read, it writes the pathname to a temporary file which the editor reads 
>and then loads into its' buffer.

[more description omitted]

I consider file(1) to be a useful heuristic program for manual use,
but I would never put it in a script for automatic use.

In other words, it's just a guesser, and does not contribute to 
making a robust application.

If you have particular requirements of a target file, you should
establish them with your own code.

David Dick
Software Innovations, Inc.



More information about the Comp.unix.programmer mailing list