ChrisAn's Blog Please read my disclaimer.

simplegeek

a.k.a. Chris Anderson

You know you're a geek when...

You do a google search for "touch" but you aren't looking for porn...

Then you find the thing you are looking for, but realize it will be quicker to just rewrite the tool yourself...

namespace touch
{
    using System;
    using System.IO;

    class Touch
    {
        [STAThread]
        static void Main(string[] args)
        {
            DirectoryInfo di = new DirectoryInfo(".");
            TouchDir(di, args[0]);
        }

        static void TouchDir(DirectoryInfo dir, string pattern)
        {
            foreach (FileInfo fi in dir.GetFiles(pattern))
            {
                Console.WriteLine(fi.FullName);
                fi.CreationTime = fi.LastWriteTime = fi.LastAccessTime = DateTime.Now;
            }
        }
    }
}

02/18/2003 10:36 PM | #Software

Content © 2003 Chris Anderson | Subscribe to my RSS feed.

Powered by BlogX