Looks pretty safe to me.
You are just in one directory.
This will delete all files with "editpost"
in the name somewhere.
I would catch errors while deleting the file
so you are not interrupted by a single
"file access error" because one file is in use.
foreach file read base [
if find file "editpost" [
if error? set/any 'err try [delete base/:file][
print mold disarm err
]
]
]
You can, by the way, say this:
home: %~/
base: join home %attempt-it/
How many files?
Anton.
> hi guys,
>
> is this script "safe?" it was taking forever, but then there are alot
> of files... I killed the process. is there a better way to do this?
>
> REBOL [
> Title: "removealot"
> Date: 27-Oct-2003
> File: %removealot.r
> RCS-Id: "$Id$"
> ]
>
> ;trace on
>
> home: to-file rejoin ["~" "/"]
>
> base: to-file rejoin [home "attempt-it/"]
>
> foreach file read base [
> if found? (find file "editpost") [
> delete base/:file
> ]
> ]
> -tom
--
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.