Cp and ditto do not always copy files the same size

2003-11-25 Thread Ari Kahn
I have a perl script that recurses through a given directory structure,
identifies files, and then reorganizes the files by placing them in a new
directory structure.

I use the cp or ditto commands to accomplish the last part.
E.g.
`cp $filename $chromat_dir`; #copy encountered file to the chromatograph_dir
or   
`ditto $filename $chromat_dir/$file_prefix$file_suffix`;

I find that sometimes the sizes of the copied files are not the same.
E.g.
Original size 192 KB
Copied size 4 KB

There are a LOT of files I am dealing with. Maybe 3 GB.

Has anyone had a similar issue?
Suggestions?

Thanks,
-- 
Ari
http://binf.gmu.edu/akahn/

We are the music makers. We are the dreamers of dreams.
Gene Wilder as Willy Wonka, quoting O'Shaughnesy



Re: Cp and ditto do not always copy files the same size

2003-11-25 Thread Doug McNutt
At 04:32 -0500 11/25/03, Ari Kahn wrote:
I use the cp or ditto commands to accomplish the last part.
`cp $filename $chromat_dir`; #copy encountered file to the chromatograph_dir
`ditto $filename $chromat_dir/$file_prefix$file_suffix`;

I find that sometimes the sizes of the copied files are not the same.
Original size 192 KB
Copied size 4 KB

I don't think that cp is able to copy resource forks though there may be an Apple 
provided option. It sounds as though you are losing them.

My MPW heritage made me put this line in my .tcshrc script.

alias files ls -lF \*/..namedfork/data \*/..namedfork/rsrc

It will show the resource forks in the current working directory


-- 
-- On the eighth day, about 6 kiloyears ago, the Lord realized that free will would 
make man ask what existed before the Creation. So He installed a few gigayears of 
history complete with a big bang and a fossilized record of evolution. --


Re: Cp and ditto do not always copy files the same size

2003-11-25 Thread Ari Kahn
It is true that I wasn't copying the resource fork specifically. But when I
use the alias you gave me, it lists the sizes for the resource forks of the
ORIGINALS as 0.

Here is a good copy:

Original
-rwxr-xr-x1 kahn admin  193189 Oct 21 23:29
504-1_G3_14937f_H01.ab1/..namedfork/data*
-rwxr-xr-x1 kahn admin   0 Oct 21 23:29
504-1_G3_14937f_H01.ab1/..namedfork/rsrc*

Copy
-rw-r--r--1 kahn admin  193189 Nov 25 05:21
504-1_G3_14937f_H01.ab1/..namedfork/data
-rw-r--r--1 kahn admin   0 Nov 25 05:21
504-1_G3_14937f_H01.ab1/..namedfork/rsrc

But apparently it does copy the resource forks?


Here is a bad copy:

Original
-rwxr-xr-x1 kahn admin  192227 Oct 13 15:03
467-1_G7_2f_G04.ab1/..namedfork/data*
-rwxr-xr-x1 kahn admin   0 Oct 13 15:03
467-1_G7_2f_G04.ab1/..namedfork/rsrc*

Bad Copy
-rw-r--r--1 kahn admin 589 Nov 25 05:29
467-1_G7_2f_G04.ab1/..namedfork/data
-rw-r--r--1 kahn admin   0 Nov 25 05:29
467-1_G7_2f_G04.ab1/..namedfork/rsrc


-- 
Ari

 From: Doug McNutt [EMAIL PROTECTED]
 Date: Tue, 25 Nov 2003 07:55:03 -0700
 To: perl.org [EMAIL PROTECTED]
 Subject: Re: Cp and ditto do not always copy files the same size
 
 At 04:32 -0500 11/25/03, Ari Kahn wrote:
 I use the cp or ditto commands to accomplish the last part.
 `cp $filename $chromat_dir`; #copy encountered file to the chromatograph_dir
 `ditto $filename $chromat_dir/$file_prefix$file_suffix`;
 
 I find that sometimes the sizes of the copied files are not the same.
 Original size 192 KB
 Copied size 4 KB
 
 I don't think that cp is able to copy resource forks though there may be an
 Apple provided option. It sounds as though you are losing them.
 
 My MPW heritage made me put this line in my .tcshrc script.
 
 alias files ls -lF \*/..namedfork/data \*/..namedfork/rsrc
 
 It will show the resource forks in the current working directory
 
 
 -- 
 -- On the eighth day, about 6 kiloyears ago, the Lord realized that free will
 would make man ask what existed before the Creation. So He installed a few
 gigayears of history complete with a big bang and a fossilized record of
 evolution. --



Re: Cp and ditto do not always copy files the same size

2003-11-25 Thread Bruce Carter
CpMac and MvMac are supposedly the Macified versions, but I always use 
ditto with the -rsrc flag.

On Nov 25, 2003, at 9:55 AM, Doug McNutt wrote:
I don't think that cp is able to copy resource forks though there may 
be an Apple provided option. It sounds as though you are losing them.

My MPW heritage made me put this line in my .tcshrc script.

alias files ls -lF \*/..namedfork/data \*/..namedfork/rsrc

It will show the resource forks in the current working directory
--
Bruce Carter, ACTC, MacCSE, MCP  http://www.nd.edu/~bcarter/
Senior Systems Engineermailto:[EMAIL PROTECTED]
Riley Hall of Art, Room 217  AIM:bcarteratnd
University of Notre Dame   +1 574 631 2967 Voice
Notre Dame, IN  46556-0539 +1 574 631 8201   FAX


Re: Cp and ditto do not always copy files the same size

2003-11-25 Thread Ari Kahn
When I do a search for the original file, I find
../../.AppleDouble/
sometimes. 
There are copies of the files I want to copy in ./AppleDouble that are 4 KB.
What is an AppleDouble?
-- 
Ari
http://binf.gmu.edu/akahn/


 From: Doug McNutt [EMAIL PROTECTED]
 Date: Tue, 25 Nov 2003 07:55:03 -0700
 To: perl.org [EMAIL PROTECTED]
 Subject: Re: Cp and ditto do not always copy files the same size
 
 At 04:32 -0500 11/25/03, Ari Kahn wrote:
 I use the cp or ditto commands to accomplish the last part.
 `cp $filename $chromat_dir`; #copy encountered file to the chromatograph_dir
 `ditto $filename $chromat_dir/$file_prefix$file_suffix`;
 
 I find that sometimes the sizes of the copied files are not the same.
 Original size 192 KB
 Copied size 4 KB
 
 I don't think that cp is able to copy resource forks though there may be an
 Apple provided option. It sounds as though you are losing them.
 
 My MPW heritage made me put this line in my .tcshrc script.
 
 alias files ls -lF \*/..namedfork/data \*/..namedfork/rsrc
 
 It will show the resource forks in the current working directory
 
 
 -- 
 -- On the eighth day, about 6 kiloyears ago, the Lord realized that free will
 would make man ask what existed before the Creation. So He installed a few
 gigayears of history complete with a big bang and a fossilized record of
 evolution. --



Re: Cp and ditto do not always copy files the same size

2003-11-25 Thread James Reynolds
I and many other lab admins are using ditto -rsrcFork to duplicate 
homefolders in our University labs and have no problem with the files 
that are duplicated.  On the other hand, cp breaks anything that has 
split forks.  I believe some lab admins are using CpMac also with no 
problems.

In the System Administration pdf on this page: 
http://www.occam.com/osx/main.html Leon towns-von Stauber discusses 
just why cp and mv don't work (page 46):

cp and mv only move data forks and leave resource forks orphaned...

Also on page 45 he talks more about data, resource, and attribute forks.

--

Thanks,

James Reynolds
University of Utah
Student Computing Labs
[EMAIL PROTECTED]
801-585-9811


Re: Cp and ditto do not always copy files the same size

2003-11-25 Thread Doug McNutt
At 11:53 -0500 11/25/03, Ari Kahn wrote:
When I do a search for the original file, I find
.../../.AppleDouble/
What is an AppleDouble?

AppleDouble and AppleSingle are file formats which incorporate the resource fork and 
the data fork and the finder information (type/creator and some other things) into a 
structure for storage on a medium that does not support the HFS specialties. They are 
commonly used for transport of Apple files over a network.

At 15:05 + 11/25/03, John Delacour wrote:
 --rsrc
   Preserve resource forks and HFS meta-data.  ditto will store this
   data in Carbon-compatible ._ AppleDouble files on filesystems that
   do not natively support resource forks.

I thought that AppleDouble would produce two files and that AppleSingle would produce 
only one but now I am a bit confused.

Are you moving files from an HFS+ volume to a UFS volume?  I doubt that 
../../.AppleDouble/ would ever exist on an HFS+ device unless, perhaps, it got there 
over a modem.

-- 

-- In Christianity, man can have only one wife. This is known as monotony. --