Linux Today: Linux News On Internet Time.

More on LinuxToday

Linuxcare: Dear Lina: File For Divorce

May 01, 2000, 16:56 (0 Talkback[s])
(Other stories by Lina)


Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame

[ Thanks to Linuxcare for this link. ]

"Dear Lina: I work in a divorce lawyer's office. He has a program that processes legal documents and court filings. Basically, he saves all email attachments he receives to a single directory, then he has to run the processor program on all these files at the end of the day. Unfortunately, this program is proprietary...I thought it might be possible to write a script for this program that first verifies the file type. What should I do?

"My goodness, dear! That sounds like a truly complicated system. It's easy to verify the file type using the awk and file commands. file is a command line utility that uses some basic heuristics to determine the file type. Over the years, hundreds of different file types have been added to a magic file that contains the heuristics. Browse through the file man pages and /usr/share/misc/magic (or /usr/share/magic on some distributions) to see if the type of file you need is supported. Here is a snippet of a bash shell script that will give you an idea of where to start..."

Complete Story

Related Stories: