path name rules

Marcel Holtmann marcel at holtmann.org
Mon Oct 3 09:15:45 PDT 2005


Hi Havoc,

> > I am developing D-Bus services for BlueZ. We would like define paths
> > names based on bluetooth device address, eg:
> > "/org/bluez/Manager/00:0D:88:BE:89:BA/Network".However, according with
> > D-Bus specification it is NOT possible use the character ":" in the
> > middle of the path name. Is there a reason for doesn't allow the
> > character ":" in the middle of the path name?
> > 
> > Specification description: 
> > 
> > - The path must begin with an ASCII '/' (integer 47) character, and
> > must consist of elements separated by slash characters.
> >  - Each element must only contain the ASCII characters
> > "[A-Z][a-z][0-9]_"
> > 
> 
> If we allow all characters, it will be a big pain in the butt since
> paths will have to be escaped wherever they are _used_ (in html, shell
> scripts, language bindings, etc.) So it's a whitelist of characters and
> paths have to be escaped when they are _created_.

using characters with no need to escape is a good idea. However
crippling the character set is bad, because the conversion can also
become a big pain.

> Why underscore and not : is basically because it doesn't seem worth
> going through ascii and thinking about each character one-by-one, and it
> seems easier for dbus programmers to remember "just alphanumeric and
> underscore" than "alphanumeric and random list of exceptions"

What is about '-'? This will make IEEE addresses more readable then
using an underscore or non separator at all.

Regards

Marcel




More information about the dbus mailing list