Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

delete folder from application server

crepmaster
Participant
0 Likes
3,921

Hy folks i'm been reading many topics about creating and deleting a folder ( entire folder) from application file.

i successufuly create a file by using command and  SM69   cmd /c   mkdir,

and that's ok, what i'm unable to do is to delete a directory.

witch command should i use?

is it all possible to zip a folder?

Regards.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,058

Hi,

you have to delete all files in your directory before deleting the directory. Otherwise, it is not possible.

The command is: rmdir -p


CALL 'SYSTEM' ID 'COMMAND' FIELD 'rmdir -p'

                              ID 'TAB'     FIELD tabl-*sys*

                   .

Afterwards, to Zip a folder, refer to the class CL_ABAP_ZIP.

Rachid.

4 REPLIES 4
Read only

former_member197622
Participant
0 Likes
2,058

Hi Marco

If you are going to use commands please search about them

it depends of your OS

as i see it looks like windows(because of mkdir) so you must use rmdir

you will find on google a lot of information about this command

regards

MC

Read only

arthur_alvesteixeira
Active Participant
0 Likes
2,058

Marco,

it's possible to create a command,

regarding your operational system (windows, linux),

using sm49 transaction.


After this use the function module SXPG_COMMAND_EXECUTE

to execute the command.

Read only

Former Member
0 Likes
2,059

Hi,

you have to delete all files in your directory before deleting the directory. Otherwise, it is not possible.

The command is: rmdir -p


CALL 'SYSTEM' ID 'COMMAND' FIELD 'rmdir -p'

                              ID 'TAB'     FIELD tabl-*sys*

                   .

Afterwards, to Zip a folder, refer to the class CL_ABAP_ZIP.

Rachid.

Read only

2,058

hello i solved by using the


cmd /c rmdir /Q /S

this allow to delete a non empty  directory.