Re: How can I delete a folder if I don't own it and don't have read/write permissions?



On 16/9/05 15:30, in article 6v0rv2-fbn.ln1@xxxxxxxxxxxxxxxxxxxx, "Chris
Brown" <cpbrown@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

>> OK. But how about this.
>>
>> Make a folder owned by you called "Mine".
>> Create in that a new folder, called "Theirs"
>> Add a load of file into "Theirs".
>> Change a few of the files in "Theirs" so you don't own them.
>> Change "Theirs" so its owned by root:wheel.
>> Try to delete some of the files in "Theirs". You can't.
>> Now try to delete the "Mine" folder you own. You can.
>> Empty the trash. You can.
>>
>> So you are not allowed to remove certain files at one level, but can nuke
>> them at another. Which seems rather contrary and inconsistent.
>
> No, it's perfectly consistent and to be expected, given that we're talking
> about directories of references, rather that folders in which the files are
> actually stored. What you have done is deleted a directory - the fact that
> the directory in question itself contained links to files which you couldn't
> remove from that directory is irrelevant.

But in effect I have deleted those files I didn't own. Are you saying that
somewhere there's an inode (whatever the damn things are called) floating
about on the disk, just waiting for someone to magically find it and add it
into a directory/list.

> Think of it as a real directory, like the Yellow Pages, for example. You
> can't remove the listing for Joe Bloggs Plumbers from the YP, but you can
> throw the YP itself in the bin.

Yeah, but other people read my Yellow Pages. Its pretty unfair if I can rip
out the pages they marked as their own. Which I can in the Finder.

>> With your model above (ta by the way, I REALLY must take a week and read
>> from cover to cover some Unix basics, rather than dipping in as and when)
>> The "list" in Mine I own, but the list in Theirs I don't.
>>
>> So how the chuff am I allowed to destroy it?
>
> You didn't destroy it - you removed their list from your list. The system
> then noted that it wasn't in anyone elses list (generally a really bad idea
> to have more than one hardlink to a directory, but it is possible), and
> deleted it itself.

But I did. I actually emptied the thrash. In the trash were files I did not
own. They are gone, unless I do something silly like trying to unerase them.

I think my problem is the Finder is doing things it really shouldn't be
doing, hence it breaking your rules. Then my head explodes.

> This is all covered in Kernighan and Pike ("The UNIX Programming
> Environment", to give it its full title) - a book that's still surprisingly
> relevant, even if it does feel a bit like an archeological dig at times.
> Anyone wanting to really *understand* UNIX, rather than just having a
> familiarity with it should really read (and own) a copy. Understanding UNIX
> is pretty much a requirement for anyone studying operating systems, and K&P
> is canon in this respect. Henry Spencer's famous quote is relevant here,
> "Those who don't understand UNIX are doomed to reinvent it, poorly".

Sigh. More reading.

.



Relevant Pages

  • Re: Another Dog Walking Find (was Spam)
    ... Melinda Meahan - take out TRASH to reply ... access on someone's Unix box using trn (stands for "threaded read ... news"), long before internet access for the common man was available, ...
    (rec.pets.dogs.behavior)
  • Re: Trash Can Alias
    ... You can in Unix, ... Aliases and soft links are nowhere near the same thing. ... where I am at the time I feel the need to the actual .trash file itself. ...
    (comp.sys.mac.system)
  • Re: How can I delete a folder if I dont own it and dont have read/write permissions?
    ... >Make a folder owned by you called "Mine". ... You didn't destroy it - you removed their list from your list. ... This is all covered in Kernighan and Pike ("The UNIX Programming ... is pretty much a requirement for anyone studying operating systems, ...
    (uk.comp.sys.mac)
  • Re: rm -R
    ... sort of trash, or are they "gone" for good? ... FreeBSD, ... not only unix, even on windows if you remove from command prompt ... removing through gui is just a wrapper that introduces all kind of tricks ...
    (Ubuntu)
  • Re: rm -R [SOLVED]
    ... Tim H. ... sort of trash, or are they "gone" for good? ... not only unix, even on windows if you remove from command prompt ... removing through gui is just a wrapper that introduces all kind of tricks ...
    (Ubuntu)