SPUG: Not reading to end of binary file on the PC

Creede Lambard creede at penguinsinthenight.com
Mon May 7 15:38:19 CDT 2001


Have you tried using binmode? It's meant to fix problems such as this.

open(FOO,"<C:/myfiles/binfile.bin") or die "Can't open the file!\n";
binmode FOO;

and from there on out it should treat control-Z just like it would any
other character.

On Mon, 07 May 2001, you wrote:
> * Johnston, Mark (mark.johnston at pnl.gov) wrote:
> > Cheryl,
> > 
> > you are using ("< $binlog") may be forcing standard input to be used as the file
> > handle.  As far as I know, standard input and standard output always interpret
> > their streams as text -- never as binary.
> 
> sorry, i don't have a solution for this as its been years since i did
> any programming on Win32 (and months since i did any Perl programming), 
> however it sounds like sysread might help you out here, if what Mark says 
> is true.
> 
> Greg
> 
> -- 
> Greg McCarroll                          http://www.mccarroll.uklinux.net
> 
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>      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/
-- 
Creede Lambard                : Never rush a miracle man.    
fearless at io.com               : You get rotten miracles.
creede at penguinsinthenight.com :       

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     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