Skip to Content

CL_GUI_FRONTEND_SERVICES=>DIRECTORY_EXISTS does this work for all OS automatically?

Hi SAP experts,

I would like to ask for an advice on using DIRECTORY EXISTS static method from CL_GUI_FRONTEND_SERVICE class.

I am trying to create a generic file validator that iterates to all directories given the path from user's file system. However, i am concerned with the user's OS, what if the user is using a different OS such as Linux or Solaris? if i am not mistaken, i believe they use slash (/) instead of backslash(\).

Will this be able to get accommodated by DIRECTORY EXISTS?


Thanks and warmest regards,

Ryann

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 20, 2015 at 01:01 PM

    Hi Ryann,

    You can use CL_GUI_FRONTEND_SERVICES=>GET_FILE_SEPARATOR to get the separator as per the Operating system.

    Thanks,

    Juwin

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 19, 2015 at 05:37 AM

    Hi,

    I am afraid you will have to use slashes as per the OS.

    Windows uses '\' while all Linux versions use '/' for directory access.

    Add comment
    10|10000 characters needed characters exceeded