Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2259 closed bug (fixed)

cp command copies BFS attributes

Reported by: shinta Owned by: emitrax
Priority: normal Milestone: R1
Component: Applications/Command Line Tools Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: x86

Description

When we copy some files by Tracker, the BFS attributes of its files are also copied. But, by cp command (/boot/beos/bin/cp), attributes are not copied.

I want cp command copy BFS attributes.

Haiku: hrev25524 SHINTA (enhancement No.3)

Attachments (1)

cplog.txt (587 bytes) - added by shinta 11 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 11 years ago by mmlr

I'd tend to classify this as invalid. The cp command has never copied BFS attributes and IMO should not either (it's a handy way of getting rid of attributes). So this is expected behaviour. There is "copyattr -d" that copies file data and attributes and should be used to achieve attribute and data copies from the command line. But I won't decide on that, waiting for other opinions.

comment:2 Changed 11 years ago by marcusoverhagen

Support for attributes was added to mv and cp in hrev8401. I tested this in hrev25634 and it still works. This bug report is invalid.

I believe this behaviour is a good idea and should be kept. There is even a command line switch to disable that.

comment:3 Changed 11 years ago by mmlr

Resolution: invalid
Status: newclosed

Right, tested this too and it works like this. Also "--ignore-attributes" does what it is supposed to do. Closing as invalid.

Changed 11 years ago by shinta

Attachment: cplog.txt added

comment:4 Changed 11 years ago by shinta

Mmm... I tried again, but, in my hrev25628, cp doesn't work.

Above is Terminal's log. TestSrc.txt is saved by StyledEdit and has some attrs. But, after cp, TestDest.txt doesn't have attrs.

cp seem to copy icon related attributes.

comment:5 Changed 11 years ago by mmlr

That'd be a bug then. Are you sure you're not using a different version of cp? Can you post what "which cp" outputs and can you check if the "--ignore-attributes" argument is listed in "cp --help"?

comment:6 Changed 11 years ago by shinta

"which cp" returns "/bin/cp" and "--ignore-attributes" argument is listed before "-i, --interactive".

comment:7 Changed 11 years ago by mmlr

Resolution: invalid
Status: closedreopened
Type: enhancementbug

Then this is a bug. What filesystem does this happen on? Also it doesn't seem that you're copying between volumes or such.

comment:8 Changed 11 years ago by shinta

Filesystem is BFS, and, src and dest volume are same.

In Senryu distribution (VirtualBox), cp works well. It may be my problem about Haiku build.

comment:9 Changed 11 years ago by emitrax

What's the status of this bug? Shinta does this still happen with the latest revision? Does cp fail to copy attributes with every file? Steps to reproduce?

comment:10 Changed 11 years ago by shinta

I found that cp doesn't copy attributes when the size of file is zero. For example, launch StyledEdit and save document before typing anything, then, cp. cp doesn't copy BeIDE's settings file's attributes, too.

Tested on hrev26003.

comment:11 Changed 11 years ago by emitrax

Owner: changed from axeld to emitrax
Status: reopenednew

Yep. Easy to reproduce. I'll look into it tonight, if no one else beats me on time. Thanks.

comment:12 Changed 11 years ago by anevilyak

Resolution: fixed
Status: newclosed

Fixed in hrev26013.

comment:13 Changed 11 years ago by shinta

It works well. Thanks!

Note: See TracTickets for help on using tickets.