Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

On an external disk (that contains a clone), the /.Trashes/501/Users/myusername/Desktop folder contains (within some subfolders) a locked invisible file that I cannot delete. The whole folder starting with 'Users' is visible in the Trash in my Dock.

I have tried:

  1. secure empty trash (it asks whether I want to delete locked files and I say yes)

  2. empty trash via Cocktail

  3. launched Terminal as root and went down to the file (admin user alone cannot cd into ./Trashes)

  4. files has these properties: -rw-------@ 1 myusername myusername 4635 Mar 3 2010 int10923.ris

  5. rm asks me whether I want to override override rw------- myusername/myusername sappnd,arch,schg,hidden for int10923.ris?

  6. I say yes, and it answers: Operation not permitted

  7. a get info on the file (in the Dock trash, first enabling viewing of invisible files for the Finder) shows it as locked but unchecking the box, it immediately re-checks itself, it permissions are myusername Read & Write, everyone No Access, trying to change that immediately reverts back to its previous state

  8. trying chflags nouchg or chflags dump on the file changes nothing (with Terminal running as root)

share|improve this question
1  
Did you try sudo rm [filename]? –  daviesgeek Aug 19 '11 at 0:08
    
I had to launch the whole Terminal.app as root which brings sudo powers (and that did not solve it), removing the flags manually was what was needed. –  noirdesir Aug 19 '11 at 0:52
    
Well...it was worth a shot. –  daviesgeek Aug 19 '11 at 3:38
add comment

3 Answers

up vote 5 down vote accepted
  1. The file could simply still be open by something. Use lsof <file> to see which process is hogging it, if any.
  2. Otherwise sudo rm -rf /.Trashes/501/Users/myusername/Desktop should get rid of it
  3. If that didn't work, try removing all the flags it's complaining about first: chflags nohidden,nosappdn,noarch,noschg <file>
share|improve this answer
    
Thanks, 3. did it, I should have googled these flags a bit more, unfortunately, man chflags has no mentions of nohidden,nosappnd,noarch, and noschg. –  noirdesir Aug 19 '11 at 0:50
1  
no*** flags are just the negation of the *** flags, which are documented on the manpage. –  zneak Aug 19 '11 at 4:29
    
Problem was I was just scanning the man page for commands and not reading much of the prose around it. As I came with the advice of chflags nouchg to the man page, I just focussed on that list starting with 'nouchg' without reading the paragraph on top of it. –  noirdesir Aug 19 '11 at 15:25
add comment

In order to modify a file that has the schg and/or sappnd bits set, you must be started up in Single-User mode.

See man chflags for more information:

As discussed in chflags(2), the sappnd and schg flags may only be unset when the system is in single-user mode.

share|improve this answer
1  
As I said above, launching Terminal as root and running chflags nosappnd did work. –  noirdesir Aug 19 '11 at 15:26
add comment

I am basically using the FEmp2, you can take a quick look at http://www.macupdate.com/app/mac/38723/femp

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.