2007 Jul 23 7:26 AM
Hi ,
I want to delete files from a directory in Application server.
I have the file name as fn_13/07/2007.txt
Have a condition that files should be deleted which are less than 10 days.
Is there any function module to do this.
Thanks in Advance.
Regards,
Indhra
2007 Jul 23 7:34 AM
Hello Indhra,
These methods may help ( from CL_GUI_FRONTEND_SERVICES )
<b>DIRECTORY_BROWSE</b> Static Method Public Shows a Directory Selection Window
<b>DIRECTORY_CREATE</b> Static Method Public Creates a Directory in the Client
<b>DIRECTORY_DELETE</b> Static Method Public Deletes a Directory in the Client
<b>DIRECTORY_EXIST</b> Static Method Public Checks if a directory exists
<b>DIRECTORY_GET_CURRENT</b> Static Method Public Returns the Current Directory
<b>DIRECTORY_LIST_FILES</b> Static Method Public Lists Files in a Given Directory
<b>DIRECTORY_SET_CURRENT</b> Static Method Public Sets the Current Directory (Do NOT Use)
<b>ENVIRONMENT_GET_VARIABLE</b> Static Method Public Gets an Environment Variable
<b>ENVIRONMENT_SET_VARIABLE</b> Static Method Public Sets an Environment Variable
<b>EXECUTE</b> Static Method Public Starts an Application or Opens a Document in the Client
<b>FILE_COPY</b> Static Method Public Copies a File
<b>FILE_DELETE</b> Static Method Public Deletes a File
Hi ,
I want to delete files from a directory in Application server.
I have the file name as fn_13/07/2007.txt
Have a condition that files should be deleted which are less than 10 days.
Is there any function module to do this.
Thanks in Advance.
Regards,
Indhra
2007 Jul 23 7:34 AM
Hello Indhra,
These methods may help ( from CL_GUI_FRONTEND_SERVICES )
<b>DIRECTORY_BROWSE</b> Static Method Public Shows a Directory Selection Window
<b>DIRECTORY_CREATE</b> Static Method Public Creates a Directory in the Client
<b>DIRECTORY_DELETE</b> Static Method Public Deletes a Directory in the Client
<b>DIRECTORY_EXIST</b> Static Method Public Checks if a directory exists
<b>DIRECTORY_GET_CURRENT</b> Static Method Public Returns the Current Directory
<b>DIRECTORY_LIST_FILES</b> Static Method Public Lists Files in a Given Directory
<b>DIRECTORY_SET_CURRENT</b> Static Method Public Sets the Current Directory (Do NOT Use)
<b>ENVIRONMENT_GET_VARIABLE</b> Static Method Public Gets an Environment Variable
<b>ENVIRONMENT_SET_VARIABLE</b> Static Method Public Sets an Environment Variable
<b>EXECUTE</b> Static Method Public Starts an Application or Opens a Document in the Client
<b>FILE_COPY</b> Static Method Public Copies a File
<b>FILE_DELETE</b> Static Method Public Deletes a File
2007 Jul 23 7:39 AM
Also, with the method <b>FILE_GET_ATTRIBUTES</b>, you may be able to get the date
2007 Jul 23 7:41 AM
You can use function module EPS_DELETE_FILE to delete the file from the application server.
Use can even use the statement
delete dataset '\tmp\file.txt'.
Regards,
Pavan
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |