PERL windows : "Windows cannot access the specified device, path orfile. You may not have the approp

G

guru

Hi,

I am getting following error
"
"Windows cannot access the specified device, path or file. You may not
have the appropriate permission to access the item."

When i tried to pass a list consisting of 300 file names.

Scenario:

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."

But when I create list of around 70 files and pass then it is working
fine.

But passing list of files as argument in linux is working fine. But
failing in windows.

Is there any alternative way to resolve this problem.

Thanks & Regards
Gururaja
 
T

Tad J McClellan

I am getting following error
"
"Windows cannot access the specified device, path or file. You may not
have the appropriate permission to access the item."

take each file and concatenate them to a list

like:

while($filename = readdir(DIR))
{
$list .= $filename;
}


So if readdir() returns "1.doc" and "2.doc", then $list (which is not a list)
will contain "1.doc2.doc".

Is that what you wanted to do?

Did you try printing out $list after the while loop?
 
G

Gunnar Hjalmarsson

guru said:
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) . '"';
 
J

J. Gleixner

guru said:
Hi,

I am getting following error
"
"Windows cannot access the specified device, path or file. You may not
have the appropriate permission to access the item."

When i tried to pass a list consisting of 300 file names.

Scenario:

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).

How are you passing the files and how is the other program
reading the input?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top