Hi everyone I'm new to these forums and really like them.
I've got somewhat of a simple question...
I want to know how to check if a file exists.
by searching the forums, I found some code and made this code to try the exemple I found.
ASSIGN FILE-INFO:FILE-NAME = "filepath".
IF NOT FILE-INFO:FILE-TYPE BEGINS "F" THEN DO:
OUTPUT TO filepath. /*to create the file*/
OUTPUT CLOSE.
END.
after this step I try to read the file with INPUT FROM filepath.
however, I still get the error that the file does not exists. So I'm guessing this does not enter the if condition...
any help would be apreciated.
thank you,
I've got somewhat of a simple question...
I want to know how to check if a file exists.
by searching the forums, I found some code and made this code to try the exemple I found.
ASSIGN FILE-INFO:FILE-NAME = "filepath".
IF NOT FILE-INFO:FILE-TYPE BEGINS "F" THEN DO:
OUTPUT TO filepath. /*to create the file*/
OUTPUT CLOSE.
END.
after this step I try to read the file with INPUT FROM filepath.
however, I still get the error that the file does not exists. So I'm guessing this does not enter the if condition...
any help would be apreciated.
thank you,