in reply to Re: Re: File::SimpleTouch module..
in thread File::SimpleTouch module..

Well, that's certainly not what any Unix person would expect from touching a file. Touching a file that already exists should leave the file unmodified. It just updates the last modification time. Also, touching a non-existing file creates an empty file, not a file with a single letter in it. Finally, touch has the ability to set the last modification (and access) time to a user specified time.

You might want to have a look at http://www.perl.com/language/ppt/src/touch/index.html. If that has any OS dependencies, I'd like to know.

Abigail

Replies are listed 'Best First'.
Re: Re: File::SimpleTouch module..
by zakzebrowski (Curate) on Sep 17, 2003 at 14:57 UTC
    Good point. I will update the code to check to see if it exists before I touch it. Also, there was a good point from the person below, who recommends changing the name to a non-touch module because it's not the expected behavior of touch... I was going to put a large discliamer in the file that it doesn't follow the 'standard touch' behaviour because of writing the 'a' character...I noticed this script in my search, but it's a script not a module... so I was heasitant to create a module from it. ...
    I think I'm just going to keep my module internally as is, and then take into considerations from this node and go from there.
    I tested your script on win32 (cygwin && activestate) and it worked fine... Thanks

    ----
    Zak
    undef$/;$mmm="J\nutsu\nutss\nuts\nutst\nuts A\nutsn\nutso\nutst\nutsh\ +nutse\nutsr\nuts P\nutse\nutsr\nutsl\nuts H\nutsa\nutsc\nutsk\nutse\n +utsr\nuts";open($DOH,"<",\$mmm);$_=$forbbiden=<$DOH>;s/\nuts//g;print +;