SPUG: Checking for ASCII files

James Moore james at banshee.com
Tue May 15 14:07:00 CDT 2001


Consider calling the UNIX "file" utility (usually found in 
/usr/bin/file) from your script.  Not a great idea if you've got huge 
numbers of files (since you're going to be forking and exec'ing too 
often), but you may find that some of the other facilities offered by 
file would be useful.

James Moore
james at banshee.com

Lorraine Johnson wrote:

> What is the best way to determine if a file
> is ASCII or non-ASCII?  
> 


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list