Why does Perl complain about "Unsuccessful stat on filename containing newline"?

Posted by Daniel on Stack Overflow See other posts from Stack Overflow or by Daniel
Published on 2010-04-16T10:46:04Z Indexed on 2010/05/29 5:42 UTC
Read the original article Hit count: 416

Filed under:
|

Hello, I am getting an error I do not understand. I am using File:Find to recurse a fylesystem on Windows using Activestate Perl 5.8.8 and trying to stat $File::Find::name; so I am not stat-ing a filename got from a text file scanning requiring chomp-ing or newline removing. I was unable to get file modification time, the mtime in:

my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($File::Find::name);

so trying a

-s $File::Find::name 

gives me the error:

Unsuccessful stat on filename containing newline

A typical file name found is F01-01-10 Num 0-00000.pdf but I get the same error even renaming in E02.pdf

© Stack Overflow or respective owner

Related posts about Windows

Related posts about perl