Add function to delete unmanaged files recursively

drewish - February 12, 2009 - 18:16
Project:Drupal
Version:7.x-dev
Component:file system
Category:feature request
Priority:normal
Assigned:drewish
Status:closed
Issue tags:D7FileAPIWishlist, ImageCacheInCore
Description

This functionality is forked off of #371374: Add ImageCache UI Core and based on code that's been in ImageCache for quite a while.

AttachmentSizeStatusTest resultOperations
file_delete_recursive.patch6.2 KBIdleFailed: Failed to run tests.View details | Re-test

#1

System Message - February 12, 2009 - 18:35
Status:needs review» needs work

The last submitted patch failed testing.

#2

drewish - February 12, 2009 - 19:08
Status:needs work» needs review

fixing a bug in the tests and a missed replacement of simpletest_clean_temporary_directory() with file_unmanaged_delete_recursive().

AttachmentSizeStatusTest resultOperations
file_373502.patch7.99 KBIdlePassed: 9664 passes, 0 fails, 0 exceptionsView details | Re-test

#3

sun - February 12, 2009 - 19:19

Straightforward. Only very minor issues:

+  // Catch all for other types of files like sockets.

...I had to read twice to understand.

+
+

Doubled blank lines in file.test.

If the tests will pass and those very minor issues are fixed, this is RTBC.

#4

drewish - February 12, 2009 - 19:43

thanks sun, fixed those issues.

AttachmentSizeStatusTest resultOperations
file_373502.patch8.12 KBIdlePassed: 9683 passes, 0 fails, 0 exceptionsView details | Re-test

#5

sun - February 12, 2009 - 20:08

We can also provide some return value. Slightly simplified that comment.

AttachmentSizeStatusTest resultOperations
drupal7-sun.file-delete-recursive.patch7.92 KBIdlePassed: 9664 passes, 0 fails, 0 exceptionsView details | Re-test

#6

drewish - February 12, 2009 - 20:10

sun, i intentionally did not return a value since you'd really need to check the whole way down the tree.

#7

sun - February 12, 2009 - 20:29
Status:needs review» reviewed & tested by the community

Removed the return value.

But also fixed some coding-style issues. Yikes!

AttachmentSizeStatusTest resultOperations
drupal7-sun.file-delete-recursive_.patch7.82 KBIdlePassed: 9664 passes, 0 fails, 0 exceptionsView details | Re-test

#8

sun - February 12, 2009 - 20:49
Status:reviewed & tested by the community» needs review
AttachmentSizeStatusTest resultOperations
drupal7-sun.file-delete-recursive__.patch7.84 KBIdlePassed: 9664 passes, 0 fails, 0 exceptionsView details | Re-test

#9

sun - February 12, 2009 - 20:54
AttachmentSizeStatusTest resultOperations
drupal7-sun.file-delete-recursive___.patch7.94 KBIdlePassed: 9683 passes, 0 fails, 0 exceptionsView details | Re-test

#10

drewish - February 12, 2009 - 20:58

how about this so we avoid checking is_file is_link over and over?

AttachmentSizeStatusTest resultOperations
file_373502.patch7.9 KBIdlePassed: 9683 passes, 0 fails, 0 exceptionsView details | Re-test

#11

drewish - February 12, 2009 - 21:23

okay, now with return value. and better docs.

AttachmentSizeStatusTest resultOperations
file_373502.patch9.13 KBIdlePassed: 9668 passes, 0 fails, 0 exceptionsView details | Re-test

#12

drewish - February 12, 2009 - 21:37

what a beautiful bikeshed we've built!

[ignore this... wrong patch]

AttachmentSizeStatusTest resultOperations
filefield_363960.patch879 bytesIdleFailed: Failed to apply patch.View details | Re-test

#13

drewish - February 12, 2009 - 21:33

with an extra the now.

AttachmentSizeStatusTest resultOperations
file_373502.patch9.13 KBIdlePassed: 9668 passes, 0 fails, 0 exceptionsView details | Re-test

#14

sun - February 13, 2009 - 00:06
Status:needs review» reviewed & tested by the community

#15

webchick - February 13, 2009 - 00:39
Status:reviewed & tested by the community» fixed

Excellent work, folks. :) Committed to HEAD.

#16

System Message - February 27, 2009 - 00:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.