Loading ...
Sorry, an error occurred while loading the content.
 

RE: [PBML] Win32::Fileop Question

Expand Messages
  • Rosenstein, Leon
    You re amazing. Thank you!!!!! ... From: Jenda Krynicky [mailto:Jenda@Krynicky.cz] Sent: Monday, September 29, 2003 3:22 PM To: perl-beginner@yahoogroups.com
    Message 1 of 5 , Sep 29, 2003
      You're amazing.

      Thank you!!!!!

      -----Original Message-----
      From: Jenda Krynicky [mailto:Jenda@...]
      Sent: Monday, September 29, 2003 3:22 PM
      To: perl-beginner@yahoogroups.com
      Subject: Re: [PBML] Win32::Fileop Question

      From: Leon <roastin@...>
      > This was really helpful and at the risk of being a
      > nuisance I have one final question. What if some of
      > files have names like .log_test or .log_blah while
      > others have suffixs like .log
      >
      > What would you suggest if I wanted to only copy over
      > the .log files but not .log_blah or .log_test?
      >
      > I am not sure if that is clear. I am trying to copy
      > only file names that end with .log if they end with
      > .log_anything I would like them not to be copied.

      Well "thanks" to the overly helpful handling of wildcards in
      Windblows you have to use the opendir+readdir+copy way:


      use File::Copy;
      opendir DIR, $sourcedir;

      while ($file = readdir DIR) {
      next unless $file =~ /\.log$/i;
      copy "$sourcedir/$file" => $destdir
      or die "Cannot copy $sourcedir/$file: $!\n";
      }
      closedir DIR;

      Jenda
      ===== Jenda@... === http://Jenda.Krynicky.cz =====
      When it comes to wine, women and song, wizards are allowed
      to get drunk and croon as much as they like.
      -- Terry Pratchett in Sourcery



      Unsubscribing info is here:
      http://help.yahoo.com/help/us/groups/groups-32.html

      Your use of Yahoo! Groups is subject to
      http://docs.yahoo.com/info/terms/



      INDEPENDENCE COMMUNITY BANK CONFIDENTIALITY NOTICE: This message
      (and any attachment) is confidential and
      intended for the sole use of the individual or entity to which it is addressed. If you are
      not the intended recipient, you must not review, retransmit, convert to hard-copy,
      copy, use or disseminate this email or any of its attachments. If you received this email
      in error, please notify the sender immediately and delete it. This notice is automatically
      appended to all Internet email.
    Your message has been successfully submitted and would be delivered to recipients shortly.