Path Separator

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pigeonrandle@hotmail.com

    #1

    Path Separator

    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:

    !"£$%^&*()_+123 4567890-
    QWERTYUIOP{}qwe rtyuiop[]
    ASDFGHJKL:@~asd fghjkl;'#
    |ZXCVBNM<>?\zxc vbnm,./`¬

    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.

  • Bruno van Dooren [MVP VC++]

    #2
    Re: Path Separator

    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
    bruno_nos_pam_v an_dooren@hotma il.com
    Remove only "_nos_pam"


    Comment

    • pigeonrandle@hotmail.com

      #3
      Re: Path Separator

      Bruno,
      Case closed! Thankyou very much.

      James.

      Bruno van Dooren [MVP VC++] wrote:
      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
      bruno_nos_pam_v an_dooren@hotma il.com
      Remove only "_nos_pam"

      Comment

      Working...