• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 158
  • Last Modified:

Testing delete of directory before actual delete

I need to delete an entire directory but I only want to start the deleting process if all the contents can be deleted. If they can't I don't want to delete anything. Is there a way to do this?
0
wallway
Asked:
wallway
  • 2
1 Solution
 
CEHJCommented:
AFAIK no. If you're worried about the 'transaction' you could always take copies of successfully deleted files so they can be restored if the transaction fails.
0
 
objectsCommented:
Only way would be to copy the entire directory before attempting delete.
0
 
objectsCommented:
you could check access privs to all files before deleting but thats not a guarantee that the delete would work but may be enuf for you.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now