Sponsored Content
Full Discussion: Retrieving File's Mime-type
Top Forums Shell Programming and Scripting Retrieving File's Mime-type Post 302273093 by jim mcnamara on Friday 2nd of January 2009 03:57:20 PM
Old 01-02-2009
If you have the .pm file for mime type checking (for example like Lite.pm for mime::lite)
you do not necessarily have to "install" the module. Just put it in your directory on the machine you are using, say /home/Rhije/Lite.pm

and add this to the shebang in the top of your own perl code
Code:
#!/bin/perl -I/home/Rhije/Lite.pm

This may not always work, but mime content-type checking is reasonably complex, so it is definitely worth a try. Rather than rolling your own. You can pack the two files in a tarball, extract them and run the perl. I know it violates your "one file" request.
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

retrieving a deleted file

hi!, is there any way to retrieve a file that I have deleted few minutes back?? I am using Solaris- 5.6.. :rolleyes: (2 Replies)
Discussion started by: jyotipg
2 Replies

2. UNIX for Advanced & Expert Users

How to Set Mime type to mailx

I have a problem while sending attachement , it is displying Content into body of mail (Junk Data) instead of attachment (zip format) in Linux, same code is working in Sun Solaris.. I have read query in this site , need to set MIME type to mailx componment. Please help me how to set MIME type..... (1 Reply)
Discussion started by: suneel
1 Replies

3. UNIX for Dummies Questions & Answers

Lynx - Downloading - extension handling - changing mime type?

Using Lynx, when I try to download a .rar, it confirms I want to download and its got it as an appication/rar file. However, split archives that end in .r## (.r00, .r01 ...) are not recognized as an appication/rar file and it reads the file like a .txt or .html. How can I fix this? Thanks! (2 Replies)
Discussion started by: yitzle
2 Replies

4. UNIX for Dummies Questions & Answers

Retrieving PID from a file

Hello I need to retrieve the content of a file in the shell script file(.sh file). I store the Process ID of the a process in file.Only the PID is available in that file. Inside the shell script i want to retireve the content(PID) and need to check for the existence of the Process.Basically... (5 Replies)
Discussion started by: appleforme1415
5 Replies

5. HP-UX

How to attach an excel file in a multipart (mime) mail

Hello. I need to send mails from hp-ux with 2 attachments: a text file and an excel file. So I'm composing a mime file which I will pipe to sendmail utility. This works fine if the only attachment is the text file (i use cat command to attach text content). But I have problems with the format... (3 Replies)
Discussion started by: elcampio
3 Replies

6. Shell Programming and Scripting

Retrieving File name

Hi All.. I have a Filename as FAB1_600015_CONRAD.A0_7XYZ12345.000_LT-SWET.01_LTPA25L_20110622-161429_07_WFR12345_20110622-161429_20110712-125228.data.dis I want to get the result as... (5 Replies)
Discussion started by: asheshrocky
5 Replies

7. Shell Programming and Scripting

MIME Type detection for Net::SMTP

I've spent a good two weeks on trying to figure out a proper way to get the mime type of a file. The "file" command on the Sparc machine I'm working on is an older version and does not support the --mime flag. It outputs things like: somefile.pdf: Adobe Portable Document Format (PDF) v1.5 ... (3 Replies)
Discussion started by: mrwatkin
3 Replies

8. UNIX for Beginners Questions & Answers

MIME type for sending gzip file as attachment in email

Hello, I am trying to send a gzip file on email using below command but the zipped file received on email is corrupt. mailsend -smtp $smtpip -content-type 'application/x-gzip' -mime-type "application/x-gzip" -t $receiver -f $sender -sub "$subject" -M "$MSG" -attach $file file name is ... (1 Reply)
Discussion started by: tushar.modgil
1 Replies
update-mime-database(1) 					   User Commands					   update-mime-database(1)

NAME
update-mime-database - build the shared MIME_Info database cache SYNOPSIS
update-mime-database -h | -v | mime-dir DESCRIPTION
update-mime-database updates the shared mime-info cache according to the system described in the Shared MIME-Info Database specification from the X Desktop Group. OPTIONS
The following options are supported: -h Display a command summary. -v Display version information OPERANDS
The following operands are supported: MIME-dir The directory for which update-mime-database should rebuild the cache. This option is mandatory if no other option is pro- vided. EXAMPLES
Example 1: Update Shared mime-info Cache for /usr/share example% update-mime-database /usr/share ENVIRONMENT VARIABLES
See environ(5). EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/update-mime-datExecutable to build the shared MIME_Info database cache ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-vfs | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
Latest version of the GNOME Desktop User Guide for your platform. gnome-vfs-mime-magic(4), gnome-vfs.applications(4), gnome-vfs.keys(4), gnome-vfs.mime(4) Shared mime info at http://www.freedesktop.org. NOTES
Original man page written by Filip Von Raemdonck (mechanix@debian.org). Updated by Matt Keenan, Sun Microsystems Inc., 2004. SunOS 5.10 6 Sep 2004 update-mime-database(1)
All times are GMT -4. The time now is 08:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy