Path Separator

  • Thread starter Thread starter pigeonrandle
  • Start date Start date
P

pigeonrandle

Hi all,

If i have (for example) a directory structure, where the names can have
ANY character in them, what would be the best method for finding a
'unique series of characters' to use as a separator?

For instance, the structure could look like this:

!"£$%^&*()_+1234567890-
QWERTYUIOP{}qwertyuiop[]
ASDFGHJKL:@~asdfghjkl;'#
|ZXCVBNM<>?\zxcvbnm,./`¬

then im stuck for using a single character (lets pretend that all the
extended characters have been used aswell - it could happen, and most
likely will if i dont prepare for it), so i have to use two characters
for the separator. But of course, all the two character combinations
could have been used (yes, that's 65536 characters - but it's
possible).

So, how would YOU do it :-)

Cheers,
James.
 
If i have (for example) a directory structure, where the names can have
ANY character in them, what would be the best method for finding a
'unique series of characters' to use as a separator?

I am going to use ASCII terminology because that is what I used when
designing protocols.

to mark the beginning and en of a protocol sequence I use combinations of 2
characters:
DLE-STX ->start of sequence
DLE-ETX-> end of sequence.

the DLE is used as an escape character that indicates that the next char has
a special meaning.

of course, DLE can also be a character within the protocol sequence.
to prevent mis-interpretations, any time there is a DLE in the sequence
itself, it is transmitted twice.
so if the target receives 2 consecutive DLE characters, it knows that there
was just a single DLE
that was just a data character instead of an escape character.

You could easily do something similar for path separation.

--

Kind regards,
Bruno van Dooren
(e-mail address removed)
Remove only "_nos_pam"
 
Bruno,
Case closed! Thankyou very much.

James.
I am going to use ASCII terminology because that is what I used when
designing protocols.

to mark the beginning and en of a protocol sequence I use combinations of 2
characters:
DLE-STX ->start of sequence
DLE-ETX-> end of sequence.

the DLE is used as an escape character that indicates that the next char has
a special meaning.

of course, DLE can also be a character within the protocol sequence.
to prevent mis-interpretations, any time there is a DLE in the sequence
itself, it is transmitted twice.
so if the target receives 2 consecutive DLE characters, it knows that there
was just a single DLE
that was just a data character instead of an escape character.

You could easily do something similar for path separation.

--

Kind regards,
Bruno van Dooren
(e-mail address removed)
Remove only "_nos_pam"
 
Back
Top