/*REXX*/
/*---- FIXS --------------------------------- 2019 - Mark McDonald -----
  Demonstrates how to fix OS dependant slashes and prefix pathing.
  Set Prefix to match your system:
          DOS     C:                (MSDOS, PCDOS, DRDOS, etc.)
      WIN/WNT     Z:\MNT\HOME       (Presumes WINE is OS)
      UNI/LIN     /mnt/home         (Normal Home Path)
----------------------------------------------------------------------*/
/*--- Set File/Pathing ---*/
      PARSE SOURCE TOS ZED ; IF TOS == "WindowsNT" THEN TOS = "WNT"
      TOS = TRANSLATE(LEFT(TOS,3))
/*--- Determine OS Slashes ---*/
      TIN  = FIXS("\U\CODE\REXX\CLOCK2.REX")
      TOUT = FIXS("\U\CODE\REXX\CLOCK2.HTM")
      TPIN = FIXS("\U\E\SPFPRO\PROFILES\COBOL.CLR")
      SAY TIN
/*--- Display Fixed Slashes ---*/
      SAY TOUT
      SAY TPIN
      PULL Z
EXIT
/*--------------------------------------------------------------------*/
FIXS: PROCEDURE EXPOSE TOS
  PARSE ARG FSPEC
  SELECT
    WHEN POS(TOS, "UNI LIN") > 0 THEN FSPEC = "/mnt/home"||TRANSLATE(FSPEC,"/","\")
    WHEN POS(TOS, "DOS MSD PCD") > 0 THEN FSPEC = "C:"||TRANSLATE(FSPEC,"\","/")
    WHEN POS(TOS, "WIN WNT") > 0 THEN FSPEC = "Z:\MNT\HOME"||TRANSLATE(FSPEC,"\","/")
    OTHERWISE NOP
  END
RETURN FSPEC