Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: File::SimpleTouch module..

by zakzebrowski (Curate)
on Sep 17, 2003 at 13:39 UTC ( [id://292114]=note: print w/replies, xml ) Need Help??


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

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

Replies are listed 'Best First'.
Re: File::SimpleTouch module..
by Abigail-II (Bishop) on Sep 17, 2003 at 14:02 UTC
    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 +;
Re: Re: Re: File::SimpleTouch module..
by Anonymous Monk on Sep 17, 2003 at 14:06 UTC
    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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://292114]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-25 13:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found