Re: PERL windows : "Windows cannot access the specified device, path or file. You may not have the appropriate permission to access the item."
- From: Gunnar Hjalmarsson <noreply@xxxxxxxxx>
- Date: Wed, 18 Feb 2009 16:30:32 +0100
guru wrote:
folder F:\Testing\loc\
Contains around 300 files
I have to pass these files as parameter to one perl script .pl,
where these files are processed( opened and read).
Alg:
take each file and concatenate them to a list
like:
while($filename = readdir(DIR))
{
$list .= $filename;
}
At the end, the list contains 300 file names.
When I pass this as parameter to .pl file in windows it is throwing
error:
"Windows cannot access the specified device, path or file. You may not
have the appropriate permission
to access the item."
Can it possibly be that there is a space in one or more of the files? In that case you may want to try:
my $list = '"' . join('" "', grep !/^\.{1,2}/, readdir DIR) . '"';
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.
- References:
- Prev by Date: Re: regexp or array?
- Next by Date: Re: Net::SSH2 scp_put not working!
- Previous by thread: Re: PERL windows : "Windows cannot access the specified device, path or file. You may not have the appropriate permission to access the item."
- Next by thread: Re: PERL windows : "Windows cannot access the specified device, path or file. You may not have the appropriate permission to access the item."
- Index(es):
Relevant Pages
|