Bob, thanks for your comments, but I have some arguments that I think it
is not a good behavior for CP.


Rivalino Matias Jr. wrote:
>> less space than the FILE size, I get the following behavior:
>>
>> [EMAIL PROTECTED] root]# ls -l teste.zero
>> -rw-r--r--    1 root     root     172933632 Set 18 23:06 teste.zero
>> [EMAIL PROTECTED] root]# cp teste.zero ./teste.zero2
>> cp: writing `./teste.zero2': No space left on device
>> [EMAIL PROTECTED] root]# ls -l teste.zero*
>> -rw-r--r--    1 root     root     172933632 Set 18 23:06 teste.zero
>> -rw-r--r--    1 root     root     138993664 Set 18 23:08 teste.zero2
>>
>> The cp doesn't remove the incomplete target file in this situation.

>Yes.  That is very traditional behavior.

When this behavior could be useful for the users ?

>> I would like to get a feedback from you if the behavior described above
>> is a BUG. In case positive, I'd like to propose a patch.

>But, but, but..., why is it a bug?  The cp command tried to execute
>your wishes to the best of its abilility to do so. It ran into an
>error and reported it.  It just does not feel like a bug to me.

This best effort behavior is not useful for situations when the file need be 
completed, which is practically the majority.
Files like libs, images, sounds, gzip, tar,  whatever binary structured  files, all 
needs be completed to be useful.
 
Another situation is when users have a list of files to copy, where some file of the 
begin is bigger than the destination device the others not. 
For example:

250 files however the thirty one is bigger than the destination device. After CP to 
try copy it and get fail, without remove it from destination device, 
the remains files can not be copied. If CP had the proposal behavior, the others files 
could be get copied. 
Of course, in the end of copying  CP will report which files get success and not 
through an user report.

Thinking as a sysadmin with an overnight background job programmed with some hundreds 
of files to copy this make sense ! 

>Also, the file could be precious. 
The file's source is kept and I agree with you it is precious and untouched. But, 
thinking what can I do with the incomplete set of bytes, I can't see any useful 
application.

>I may have spent hours or days copying a huge file.  I don't want to lose that 
>already spent effort
by having cp remove what it already copied. 

Well, thinking in a majority of situations how can it partially copied file be useful 
? If isn't useful, why keep it if I could have more files being copied to destination 
device in a list, like above sample ?

Anyway, I'm here to contribute with a patch or ideas in this case...

Regards,

RMJ.





_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to