|View discussion [1 post]||View script||License||Download documentation as: HTML or editable|
|Download script||History||Other scripts by: greggirwin|
24-Aug 2:45 UTC
Script Library: 1222 scripts
Documentation for: file-list.r
Cutting to the chase, here's how you use it. You can give it just a spec, as a file! or multiple specs, as a block! %*.txt [%*.txt %*.r] You can include date checks [%*.txt changed after 1-Aug-1998] [%*.txt changed before 1-Aug-1998] And size checks [%*.txt changed after 1-Aug-1998 >= 10 kb] [%*.txt changed after 1-Aug-1998 < 10 kb] And attribute checks [%*.txt changed after 1-Aug-1998 >= 10 kb system] [%*.txt changed after 1-Aug-1998 >= 10 kb not system] [%*.txt changed after 1-Aug-1998 < 10 kb read-only] [%*.txt changed after 1-Aug-1998 < 10 kb not read-only] And they can come in pretty much any order you want [ < 10 kb %*.txt not read-only changed after 1-Aug-1998] [not read-only < 10 kb changed after 1-Aug-1998 %*.txt] [not read-only < 10 kb changed after 1-Aug-1998 %*a*.txt] For details on the sub-dialects, take a look at the USAGE string in each of the contexts. There are a couple default specs, so it ignores hidden and system files by default, and certain sub dirs like CVS and SVN dirs. You can turn the defaults off, though it's ugly how you do that right now. find-file-ctx/use-defaults: no Yeah, ugly as sin, module level; I know. I decided to add it as a test and, hey, how often are you really going to use it anyway. ;) If you don't want it to return a block of files, you can use the /callback refinement, and you can use /deep to recurse through sub-dirs. Once you have a list of files, you can remove files from that list, with the same dialect you used to add them. There is also a REFRESH-FILE-LIST function that will remove any files which no longer exist on disk.