permissions element and mkdir

Mark Ellis markp.ellis at ntlworld.com
Wed Jul 6 02:50:36 PDT 2005


On Tue, 2005-07-05 at 08:00 -0500, James Robertson wrote:
> Mark Ellis wrote:
> > 
> > As a concept, <permissions> in mkdir is fine, but we have <permissions>
> > defined as a completely separate handler, is it wise to use an element
> > of the same name in two completely different situations ? The DTD
> > description of mkdir actually points to the permissions handler, which
> > would be moderately non-sensical, as this would be asking for the base
> > dir and target file information twice for the same operation. At best
> > you'll never be able to validate a profile, at worst this will be
> > downright confusing.
> > 
> > Any thoughts ?
> > 
> > Ta
> > Mark
> > 
> Just think of the <permissions> element as a wrapper for the chmod 
> command.  It allows you to set permissions on a directory when you 
> create it, like the install command allows, all in one step. I do not 
> understand what you are speaking about in the last part of your second 
> paragraph.
> 
> James

Hmm, didn't make much sense there did I ? Lets try again with an
example.

<mkdir base="foo">
    <option>parents</option>
    <name>bar</name>
</mkdir>

Now looking at the nALFS code, I would guess that to set permissions at
crestion time you would...

<mkdir base="foo">
    <option>parents</option>
    <permissions>755</permissions>
    <name>bar</name>
</mkdir>

However, according to the DTD docs, if you wanted to set permissions at
creation time you would do this....

<mkdir base="foo">
    <option>parents</option>
    <permissions base="foo" mode="755">
        <name>bar</name>
    <name>bar</name>
</mkdir>

I'm guessing this second one isn't the intention, in which case using an
element named 'permissions' in mkdir could be downright confusing, and
you'd never be able to validate a document.

Make sense ?

Mark





More information about the alfs-discuss mailing list