[Stackoverflow] [Progress OpenEdge ABL] File not getting delete through code flow in Progress4GL

  • Thread starter Thread starter Manny
  • Start date Start date
Status
Not open for further replies.
M

Manny

Guest
If i run OS-DELETE using the same procedure editor it deletes but if i run through application it copies the file but the delete is not happening. Code below:

WHEN "Processed" THEN DO:

Code:
OS-COPY VALUE(TT-ACT-FILES.FilePath) VALUE(TT-ACT-FILES.ProcessedPath).

/* Check if the copy operation resulted in an error */
IF ERROR-STATUS:ERROR THEN DO:
    MESSAGE "Error copying file: " ERROR-STATUS:GET-MESSAGE(1) VIEW-AS ALERT-BOX.
    RETURN.
END.

/* Debug message for the copy operation */
MESSAGE "File copied successfully from :" (TT-ACT-FILES.FilePath) " to " (TT-ACT-FILES.ProcessedPath) VIEW-AS ALERT-BOX.

/* Check if the source file exists before deletion */
IF SEARCH(TT-ACT-FILES.FilePath) <> ? THEN DO:
    /* Attempt to delete the original file */
    OS-DELETE VALUE(TRIM(TT-ACT-FILES.FilePath)) NO-ERROR.

    /* Check if delete operation was successful */
    IF ERROR-STATUS:ERROR THEN DO:
        MESSAGE "Error deleting original file: " ERROR-STATUS:GET-MESSAGE(1) VIEW-AS ALERT-BOX.
    END.
    ELSE
        MESSAGE "Original file deleted successfully." VIEW-AS ALERT-BOX.
END.
ELSE
    MESSAGE "Source file does not exist for deletion: " (TRIM(TT-ACT-FILES.FilePath)) VIEW-AS ALERT-BOX.

END.

Continue reading...
 
Status
Not open for further replies.
Back
Top