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



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
.



Relevant Pages

  • Re: Help regarding Perl modules in .pl and .in extension.
    ... > I am having problems when referencing to modules that have the extension .pl ... are a Perl script and a template ... If the module you want doesn't come pre-packaged for windows, ... be hard to install. ...
    (comp.lang.perl.misc)
  • How to manipulate environment variables in parent process?
    ... Is it possible to write a perl script to manipulate the environment ... Normally, you can manipulate environment variables, but they only have ... I have a windows bat file and everyday I have to edit it to contain the ...
    (perl.beginners)
  • RE: Pure Perl df
    ... I'm at a loss and need help. ... > Perl script. ... Your friend will have to see if this function ... On Windows, I'd use Win32::DriveInfo ...
    (perl.beginners)
  • Re: make perl script into a service
    ... "How do I run a Perl script as a Windows 200x/XP Service? ... Could I use these modules to make my perl script into a service? ... With activestate perl I was able to install like ... other set of functions help you respond correctly to service ...
    (perl.beginners)
  • Re: open pipe for system call does not work on windows
    ... make sure you're using a reasonabally modern perl on Windows. ... > I'm writing a perl script to spawn child processes to execute jobs. ...
    (comp.lang.perl)