Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Feb 2007
    Location
    London
    Posts
    225
    Thanks
    16
    Thanked 2 Times in 2 Posts

    DIRECTORY_SEPARATOR v. PATH_SEPARATOR

    Is there any difference between DIRECTORY_SEPARATOR and PATH_SEPARATOR ?

    I can't find any documentation that clarifies this.

    Oh, and a follow-up question:
    When defining absolute paths as constants, am I correct in saying that Windows will handle the Unix separator just fine, and that DIRECTORY_SEPARATOR is therefore redundant for portability purposes; a simple forward slash will suffice?
    Last edited by cfructose; 03-31-2010 at 09:30 AM. Reason: Adding 'Resolved'

  • #2
    Regular Coder xconspirisist's Avatar
    Join Date
    Jun 2006
    Location
    Great Britain.
    Posts
    138
    Thanks
    1
    Thanked 6 Times in 6 Posts
    Indeed there is.

    DIRECTORY_SEPARATOR is to separate directories within a path. On linux it is /

    Code:
    /var/www/myfile
    PATH_SEPARATOR is to separate paths within a string. On linux it is a colon ( : ). An example of where you would want to do this is set_include_path(). On windows I think it is a semicolon ( ; ).

    Code:
    /var/www/myfile:/home/myfile:/tmp/myfile
    Last edited by xconspirisist; 03-30-2010 at 02:19 PM.
    If I have been helpful, use the "thank" button - It makes me happy!

    xconspirisist.co.uk - homepage of my online alias
    technowax.net - a community for people interested in all forms of modern technology.

  • #3
    Regular Coder
    Join Date
    Feb 2007
    Location
    London
    Posts
    225
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Wow, I'd completely misunderstood that.

    Thanks.


  •  

    LinkBacks (?)


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •