in reply to File::SimpleTouch module..

Would this be valuable to other people and any namespace issues?

Without seeing the code - who knows...

Also, a bug report and/or patch to File::Touch would probably be more useful.

Replies are listed 'Best First'.
Re: Re: File::SimpleTouch module..
by zakzebrowski (Curate) on Sep 17, 2003 at 13:39 UTC
    The problem is intelectuall rights. I can't distribute a module without going through the aproval process, so I can't share it until I distribute it... (It's basicaly just exporting 'touch', and then the sub is touch{my $fn = shift; open(OUT,..) print OUT "A"; close (OUT); The past few times I've contacted module authors directly, I haven't had good luck with getting them to write a patch, though the amount of spam that I use from the account I write the email has gone up signifigantly... Also, it appears that the module's author had a different intention when writing modules (The author seems to be more concerned about time of file activitiy versus just simply touching the file, which is all I'm concerned about.)...

    ----
    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 +;
      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

        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 +;
      A module that opens a file, prints one character and then closes the file shouldn't be related in name to File::Touch. Call it File::NotTouch::Open::Write::Close or something. That way people will know that it is specail purpose code that has nothing to do with the touch(1) command. Otherwise, submit a bug report to the author of Touch::File (with a patch if you can) or shell out the touch command. But please, please don't contribute that clutter to a namespace that poor unsuspecting souls will confuse with a simple interface to touch(1).

      -- am