[Stackoverflow] [Progress OpenEdge ABL] What is the best way to have a unique file name for each files?

Status
Not open for further replies.
T

Thiru Malai

Guest
I have written a program for export some text files to a specific directory also i preferred using MTIME is best way to each exporting files to have unique name but the problem is from our server and another process is exporting same file name using MTIME with different data's so there will be a chance for coincidence and over writing. Could you please tell me the best way to have a unique file name? Let me share some sample.

DEFINE INPUT PARAMETER ipData1 AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER ipData2 AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER ipData3 AS CHARACTER NO-UNDO.

DEFINE VARIABLE cExportData AS CHARACTER NO-UNDO FORMAT 'X(250)'.
DEFINE VARIABLE cPath AS CHARACTER NO-UNDO.
DEFINE VARIABLE cExt AS CHARACTER NO-UNDO.
DEFINE VARIABLE cSFTL AS CHARACTER NO-UNDO FORMAT 'X(150)'.
DEFINE VARIABLE cMessageDateTime AS CHARACTER NO-UNDO.


ASSIGN
cPath = "R:\Downloads\progress\"
cExt = ".Txt"
cMessageDateTime = "123456789".

OUTPUT TO VALUE (cPath + cMessageDateTime + STRING(MTIME) + cExt ).

put unformatted ipData1 skip ipData2 skip ipData3 skip "End."

OUTPUT CLOSE.


If you see the sample its related to my logic. I am passing 3 input parameter from FOR EACH loop in another procedure so than I can get each file with unique name but used MTIME. So could you pls tell me the alternative way ??

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