On Fri, Jul 04, 2008 at 10:51:47AM -0700, Sagar Borikar wrote:
>
> Copy is of the same file to 30 different directories and it is basically
> overwrite.
Not an overwrite - cp truncates the destination file first:
# cp t.t fred
# strace cp -f t.t fred
.....
stat("fred", {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
stat("t.t", {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
stat("fred", {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
open("t.t", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=5, ...}) = 0
open("fred", O_WRONLY|O_TRUNC) = 4
^^^^^^^^^^^^^^^^
fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
read(3, "fred\n", 4096) = 5
write(4, "fred\n", 5) = 5
close(4) = 0
close(3) = 0
.....
That being said, I can't reproduce it on a 2.6.24 (debian)
kernel, either.
Cheers,
Dave.
--
Dave Chinner
david@xxxxxxxxxxxxx
|