5fc @verb #101:"bf_renumber" this none this rxdo #55 @program #101:"bf_renumber" this none this set_task_perms(caller_perms()) if (task_id() in this.hard_creating_tasks && caller_perms().wizard) this.hard_creating_tasks = setremove(this.hard_creating_tasks, task_id()) orig = args[1] origdir = `orig:basedir() ! ANY' retval = pass(@args) if (retval == orig) "Didn't change the object number. We don't need to move files or anything silly like that." return retval endif "Hard-created new object number. It might need a new directory for itself on the filesystem, so create one." if (typeof(origdir) != ERR && typeof(basedir = `retval:basedir() ! ANY') != $ERR) dirs = $string_utils:explode(basedir, "/") existing = "" for dir in (dirs) `filemkdir(existing, dir) ! E_PERM' existing = existing ? tostr(existing, "/", dir) | dir endfor filelist = `filelist(origdir) ! ANY' if (typeof(filelist) != $ERR) {files, dirs} = filelist for file in (files) try filewrite(basedir, file, fileread(origdir, file)) filechmod(basedir, file, filechmod(origdir, file, "*")) filedelete(origdir, file) except (ANY) $wiz_utils:guard_alert(tostr("Error moving file \"", file, "\" when renumber()ing ", orig, " to ", retval, ".")) endtry endfor endif endif return retval else return raise(E_PERM) endif "Last modified by Dax (#789) on Wed May 4 06:46:29 2005 MDT." . 0