System path separtor

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #465
    liquider
    Member

    Hi guys!!

    Does anyone how to get system path separator? I would like to obtain “\” when I execute my program in Windows and “/” when I execute it on Unix.

    Thanks!!

    #467
    bryan
    Participant

    You could write something to do it manually:

    path.sep <- function (x) { if (x == "windows") { "\\" } else { "/" } } path.sep(.Platform$OS.type) Which can be extended to fit numerous needs. .Platform$file.sep is related and might be helpful in other cases, but wouldn't help you in this situation.

    #469
    liquider
    Member

    Thanks Bryan.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Scroll to top
Privacy Policy