To delete a folder and all of its contents including subdirectories, you
can use the STAF FS service's DELETE ENTRY request with the RECURSE
option. For example:
STAF machine FS DELETE ENTRY /tmp/myfiles RECURSE CONFIRM
However, this won't delete any read-only files.
So, you could either change the permissions of any read-only files
contained within the directory so that they are not read only (e.g. using
a STAF PROCESS START request to run an OS command like chmod, etc) before
using the STAF FS DELETE request.
Or, you could run an OS command that allows you to delete read-only files.
For example, on Unix machines like Linux, you could use the "rm -Rf"
command with the Recursive and Force options to remove a directory and all
of its contents including subdirectories and read-only files. For
example:
STAF machine PROCESS START SHELL COMMAND "rm -Rf /tmp/myfiles"
RETURNSTDOUT STDERRTOSTDOUT WAIT
--------------------------------------------------------------
Sharon Lucas
IBM Austin, luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313
From: Cindy Zhu <c...@fekete.com>
To: "staf-users@lists.sourceforge.net"
<staf-users@lists.sourceforge.net>
Date: 04/13/2011 02:32 PM
Subject: [staf-users] Delete a folder with subfolders and read-only
files
Hi,
How to delete a folder with subfolders and read-only files from STAF
command?
Thanks,
Cindy
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about
boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users