You can use the FILE-INFO attributes to see if a directory exists or if you have rights for writing in it.
FILE-INFO:FILE-NAME = "/home/user1/dir1".
IF substring(FILE-INFO:FILE-TYPE,1,1) = "D"
THEN
MESSAGE 'Directory exist'
VIEW-AS ALERT-BOX INFO BUTTONS OK.
ELSE
MESSAGE 'Directory doesn't exist'
VIEW-AS ALERT-BOX INFO BUTTONS OK.
I suggest you write the file on you local hard because put statement does not have an no-error option. After you are done with the file use OS-COPY to copy the file on the mapped directory.
Possible solution
Hi,
You can use the FILE-INFO attributes to see if a directory exists or if you have rights for writing in it.
FILE-INFO:FILE-NAME = "/home/user1/dir1".
IF substring(FILE-INFO:FILE-TYPE,1,1) = "D"
THEN
MESSAGE 'Directory exist'
VIEW-AS ALERT-BOX INFO BUTTONS OK.
ELSE
MESSAGE 'Directory doesn't exist'
VIEW-AS ALERT-BOX INFO BUTTONS OK.
Thanks for answer! But what
Thanks for answer!
But what should I do in next situation: "dir1" is mapping network resource and network link goes down at middle of writting?
Workaround
Hi,
I suggest you write the file on you local hard because put statement does not have an no-error option. After you are done with the file use OS-COPY to copy the file on the mapped directory.