-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues on Windows Drives (fatal error: System Volume Information: Invalid argument) #36
Comments
What's line 250? I'm going to have to rely on someone on Windows to figure this out. (Also, as an aside, you can leave out the |
Can you please post a simplified version of the code that reproduces the error, and post the entire program, and then also include |
@petdance done -- see next comment.
More information though: I was able to work around the issue, for now, with this change to the descend filter:
What's throwing the error with File::Next is the user (even administrator) does not have permission to look inside the "System Volume Information" folder (which is hidden). The permissions set on the folder is "SYSTEM" and nothing else so when Next.pm tries to do anything with it, it will croak. However, this will occur on any Windows NTFS formatted drive when traversing the root folder. It might be easiest in File::Next to simply have descend_filter default to filter out "System Volume Information" folders by default on Windows. |
Test Script: (M: in this case is a USB WD Passport drive formatted as NTFS on a Windows 7 system)
stderr:
|
I don't want to go down that road of making changes to behavior based on install. However, I do think that this is important info and would be good to have in the documentation somewhere. I will write it up at some point to put in the docs, or if you can that would be great, too. I think that most of what we'd want to have in the docs is in this ticket. Do you know if this problem you ran into is only on certain versions of Windows? |
This will likely occur on any NTFS formatted drive (although a mounted NTFS drive on *nix will probably ignore the Windows permissions). (I think the folder's been in use since at least Windows XP, possibly earlier.) For some more info on it: MSDN Devblog article from 2003 (It will also likely occur on *nix if any directory or file doesn't allow the script to open/look at it but I haven't tested for that specifically.) (I renamed the issue with the error message to help with searching.) |
Using File::Next in a script to catalog files on USB mounted drives and I'm getting this fatal error:
M:\System Volume Information: Invalid argument at C:/Perl/site/lib/File/Next.pm line 250.
(M is the external drive map).
The code is fairly simple:
$iteration = File::Next::files( { descend_filter => sub{1}, sort_files => 1}, $source_folder );
...
while ( defined ( $source_file = $iteration->() ) ) {
The text was updated successfully, but these errors were encountered: