frostrap Posted August 15, 2008 Share Posted August 15, 2008 I'm stumped. The following code returns filenames, but only returns nil for the modification date of each file. This code is just the building block for a simple program that will purge .bak files from a specified folder after they've been in there for some given period of time. Any ideas why I'm only getting nils returned to me? (defun Sbu(/ thefile thelist datemodified) (vl-load-com) (setq thelist (vl-directory-files "c:\\test\\" "*.*" 1)) (foreach thefile thelist (setq datemodified (vl-file-systime thefile)) (print thefile) (print datemodified) );foreach (princ) );defun Thanks, Joe Quote Link to comment Share on other sites More sharing options...
wizman Posted August 15, 2008 Share Posted August 15, 2008 (defun Sbu (/ thefile thelist datemodified) (vl-load-com) (setq directory "c:\\test\\") (setq thelist (vl-directory-files directory "*.*" 1)) (foreach thefile thelist (setq datemodified (vl-file-systime (strcat directory thefile))) (print thefile) (print datemodified) ) ;_ end_foreach (princ) ) ;_ end_defun Quote Link to comment Share on other sites More sharing options...
frostrap Posted August 15, 2008 Author Share Posted August 15, 2008 Oh, I see my error now. I was referencing the filename, but had omitted the path. Thanks wizman! Quote Link to comment Share on other sites More sharing options...
wizman Posted August 15, 2008 Share Posted August 15, 2008 you're welcome joe Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.