Seems like maybe a programming question, but my experience has been that admins are the right crowd for this?

A. I have about 10,000 files that are just enumerated and all in one directory - fl000001.pdf....

B. I also have a comma delimited file with meta-data for these files (i.e. filename, ImageID, Author,Date,Client).

This will end up being a largely static data-set, and we're going to use the file system to organize them by concatenating the fields together and renaming/move them to that (so f:\data\2012-12-23\author\clientname.pdf).

This is pretty trivial and I've done a lot of this and I'll probably use Python, but I would like to take it to the next step, and I think I've seen this, so I'm looking for some referral and further suggestions for the exercise.

Isn't there some way (other than rolling back a vm) to virtualize the files system, or a portion of the file system, so that any changes I make don't actually take until I commit them, or maybe do the same operation on a non-virtualized part of the file system after just testing it on the virtualized file system?

I found sandboxie and that seems like the right guy but are there other application/methods/suggestions that are appropriate for this? http://www.sandboxie.com/ Has anyone used sandboxie for this kind of thing? Other ideas, is the payoff for this too low? ;)


Many times, the client doesn't know exactly what they want, and I'm thinking this would be an easy way to set some program parameters, run the rename, which is fast, but hard to roll-back (unless I did it programmatically, but since it might fail, this seems easier?), they can get a look, right there in the meeting they get a look, we can adjust, roll the file system back, and re-run the rename.

I can do this in either windows 7, windows 2008r2, or linux - no macs and I'll sanitize/enumerate-names and so on so that hopefully it's very dumbed down file names to be tolerant of file system limitations/quirks/rules.


Close to mfinni's answer, but use hardlinks instead. In short terms you're creating another pointer on the disk to the same file. You can remove one or the other and still have the original file on disk.

This way you keep the original file and folder structure, and as a bonus the script will run nearly instantly, as it doesn't have to create copies of the actual files.

| improve this answer | |
  • +1 for hardlinks. For me hardlinks were a bit confusing until I grasped that all hardlinks are equally valid "names" for a file, and the data is not marked as overwritable until the last hardlink is removed. The "Files and Folders" metaphor which GUIs impose on filesystems is a useful shorthand, but it can be a limiting metaphor. – AndyN Dec 17 '10 at 18:29

My suggestions for easy rollback using native tools, without virtualizing your filesystem:

  1. Write a script to do it and write a script to reverse it.
  2. Write a script to create symlinks with the new filenames instead of renaming the files.
  3. Write a script to do this as copy-with-rename, not as a simple rename - thus, you have the original files in the original location.
| improve this answer | |
  • yeah, you're kind of what I'm looking for - the idea was to do it all in a virtualized space because it would be fast - doing an actual copy eats a lot time - lot of time between iterations of renaming scheme... – bif Dec 17 '10 at 15:43
  • So do it with symlinks. Or don't copy the files at all - just get a list of filenames and run the script to change them without actually moving the physical files around, and have the client review that. Or do the copy/rename on a representative subset and have the client review that. Or bill the client per hour and do whatever they tell you, which is what you should be doing anyway. If they want to dick around, let them pay for it. – mfinni Dec 17 '10 at 15:57
  • I usually write a script even when I don't plan to undo it. I do it to make sure I understand the data before committing it. Database application developers do this to with data injest from a "dirty source" where the input is less than organized. Use a script to catch scenarios you hadn't anticipated. Still, hard links are absolutely the best way to go here. Instead of mv, use ln and all will be well. – zerolagtime Dec 20 '10 at 1:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.