rkrasowski has asked for the wisdom of the Perl Monks concerning the following question:
I got stock on this problem. I am trying to move emails from new to cur folder, I check the content of directory first and after that try to move it:
Well it does not work and I think the reason is the name of the file with periods, comas etc like: 1340717641.M913153P29268.krasowski,S=3001,W=3072:2,S. Any idea how to solve this ?? Thanks like always Robert#!/usr/bin/perl use strict; use warnings; my $newDir = "/home/iphone/Maildir/new"; my $curDir = "/home/iphone/MailDir/cur"; opendir(DIR, "$newDir"); my @FILES= readdir(DIR); closedir DIR; foreach (@FILES) { my $newFile="$currentDir"."\/".$file; my $curFile="$oldDir"."\/".$file; rename $newFile, $curFile; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Usig file name without backslash escape
by Kenosis (Priest) on Jun 28, 2012 at 02:31 UTC | |
by rkrasowski (Sexton) on Jun 28, 2012 at 03:36 UTC | |
|
Re: Usig file name without backslash escape
by jwkrahn (Abbot) on Jun 28, 2012 at 01:15 UTC | |
by rkrasowski (Sexton) on Jun 28, 2012 at 03:00 UTC | |
by aaron_baugher (Curate) on Jun 28, 2012 at 03:26 UTC | |
by Athanasius (Archbishop) on Jun 28, 2012 at 03:24 UTC | |
|
Re: Usig file name without backslash escape
by zachhilbert (Initiate) on Jun 28, 2012 at 08:55 UTC | |
by AnomalousMonk (Archbishop) on Jun 28, 2012 at 20:50 UTC | |
by rkrasowski (Sexton) on Jun 28, 2012 at 21:57 UTC |