Copying an exec file!!HELP!! 
Author Message
 Copying an exec file!!HELP!!

HI!,

        The standard way to copy a file into another file:

read (FROM, $buf, 10000);
print TO $buf;

          DIdn't work for a java code.  It was a .class file and I
thought maybe I had to set the perl program to read in binary or ascii
codes or..?  I don't know what I can do.

        Please let me know if you have any idea as to how to do that.  I
would really appreciate and help you can offer.

        Thank you for your attention,

    -=Cindy=- -=Cindy=- -=Cindy=-
-=Cindy=- -=Cindy=- -=Cindy=- -=Cindy=-



Mon, 22 Mar 1999 03:00:00 GMT  
 Copying an exec file!!HELP!!

Quote:

> HI!,

>         The standard way to copy a file into another file:

> read (FROM, $buf, 10000);
> print TO $buf;

Perl doesn't make a distinction between text and binary files. Try
something like this:

sysread(FROM, $buffer, $bytes);
syswrite(TO, $buffer, $bytes);

I've used this method in programs that I have written to copy portions
of binary data out of one file into another. I works great for me.

Mark



Tue, 23 Mar 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. EXEC to copy files

2. Using File::Copy and Sockets to copy public files from http addresses

3. File::Copy, copying files problem.

4. Warning using copy from File::Copy

5. Semantics of File::Copy::copy(,)

6. Help needed to copy files

7. File::Copy help needed

8. Help needed to copy files

9. Seek Help for copying binary files

10. Help with opening and copying to a file

11. Newbie help: copying files

12. Help me copy files to diskette in perl script

 

 
Powered by phpBB® Forum Software