Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > PERL windows : "Windows cannot access the specified device, path orfile. You may not have the appropriate permission to access the item."

Reply
Thread Tools

PERL windows : "Windows cannot access the specified device, path orfile. You may not have the appropriate permission to access the item."

 
 
guru
Guest
Posts: n/a
 
      02-18-2009
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
 
Reply With Quote
 
 
 
 
Tad J McClellan
Guest
Posts: n/a
 
      02-18-2009
guru <> wrote:


> 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?


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      02-18-2009
guru wrote:
>
> while($filename = readdir(DIR))
> {
> $list .= $filename;
> }


How about

my $list = join ' ', readdir DIR;

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      02-18-2009
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
 
Reply With Quote
 
J. Gleixner
Guest
Posts: n/a
 
      02-18-2009
guru wrote:
> 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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
! Windows unable to access specified path, file. Perhaps you may not have the appropriate permission to open the item Knowledge Computer Support 2 04-06-2007 06:25 PM
Windows cannot access the specified device path or file. You may not have the appropriate permissions to access the item. strollingjj Computer Support 11 12-03-2006 01:27 PM
You may not have permission to use this resource! =?Utf-8?B?Um9nZXIgQw==?= Wireless Networking 1 02-26-2006 06:31 PM
[MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Rob Dob ASP .Net Web Controls 0 11-27-2005 03:57 PM
[MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Rob Dob ASP .Net 0 11-27-2005 03:57 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57