in reply to Windows folder access error
Add $^E to your error report and you might get a better idea what is going wrong.
My only guess is that your script is running in a context where it doesn't have a current "working drive" and if you prepend the "C:" to your string, that it might fix the problem.
You can see the code that is producing this error at p5git://win32/win32.c., in particular:
dirp->handle = FindFirstFileW(PerlDir_mapW(wscanname), &wFindData) +; if (dirp->handle == INVALID_HANDLE_VALUE) { DWORD err = GetLastError(); /* FindFirstFile() fails on empty drives! */ switch (err) { case ERROR_FILE_NOT_FOUND: return dirp; case ERROR_NO_MORE_FILES: case ERROR_PATH_NOT_FOUND: errno = ENOENT; break; case ERROR_NOT_ENOUGH_MEMORY: errno = ENOMEM; break; default: errno = EINVAL; break; } Safefree(dirp); return NULL; }
So EINVAL (invalid argument) just means "not ERROR_NO_MORE_FILES, ERROR_PATH_NOT_FOUND, nor ERROR_NOT_ENOUGH_MEMORY". $^E should tell you what GetLastError() returned.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Windows folder access error ($^E)
by ArifS (Beadle) on Oct 24, 2014 at 16:21 UTC | |
by perlron (Pilgrim) on Oct 24, 2014 at 18:01 UTC |