Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I use this tiny script in conjunction with Kazaa Lite, a P2P file-sharing application. The script checks the Kazaa shared folder continually for incoming (finished) files, and then moves them into a different location. Once they are moved into an unshared folder, other people can no longer download them from the system Kazaa Lite is running upon. This limits upstream bandwidth consumption, which is a nice side effect if throughput is important to you (or you would like to not attract attention from your ISP, which may or may not be banning servers in their TOS.)

I wrote this script in response to the MPAA's decision to start finding people sharing files, and hassling their ISP to try to get their service disconnected. I know that many people here probably don't agree with file sharing in general, or perhaps some may think it is rather dispicable to not share files in return with the other members of the file-sharing communities, but I personally only use Kazaa Lite occasionally to download MP3s or VHS captures of movies I already own (which is arguably legal under the Fair Use Act), and I feel no obligation to continue sharing the files with the rest of the world after I have them.

So, I just let this run in the background while I am running Kazaa Lite. I'd like to extend it at some point to sort files by type, or maybe even try and get clever and have it guess whether it's a Los Lobos song and create a directory for it or whatnot. Probably not, though. I've been a busy boy lately.

# c:\perl\lib\MyService.pl use strict; use warnings; use File::Copy; my $dir = "C:\\Program Files\\Kazaa Lite\\My Shared Folder"; my $dest = "C:\\incoming"; while (1) { opendir(DIR,$dir) || die "can't opendir $dir: $!"; while(my $file = readdir(DIR)) { if ($file=~/\.dat$/i) { my $i = '1'; } else { move ("$dir\\$file", "$dest\\$file"); } } sleep(3); closedir DIR; }

P.S. This is running on a Windows 98 computer, but it can be converted to run as a service under NT/2000 by following this handy guide. I know it's not that hard of a script to write, but maybe someone else out there can use it.


In reply to Kazaa Lite Companion by Dragonfly

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (11)
    As of 2014-09-02 13:23 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite cookbook is:










      Results (22 votes), past polls