Solved

Number of files limit per folder in XP?

Posted on 2016-08-29
12
83 Views
Last Modified: 2016-08-31
Hi experts, I have a laptop with XP SP3, file system: NTFS, and I'm running a stock price downloading program (www.yloader.com) to download a large list of US stocks. It creates a folder with 4,469 files, one for each stock, each pretty small (about 45K). So the total size of files in the folder is only about 325 megs. I wrote a small program to read and process these stock data files but it's now having problems opening up and reading the files in this folder. Plus, some of the files in there, when I just try to manually open them in Notepad, it says "Access denied" - not all of them but just some. Anyhow, just some really strange behaviour going on. This is my first run gathering this many stock files - before it was just a couple thousand and I had no problems. I saw somewhere online that there may be a 4096 files limit per folder in XP... if so, then that could very well be what I'm running up against. Any thoughts anyone?

Thanks
   Shawn
0
Comment
Question by:shawn857
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 48

Expert Comment

by:dbrunton
ID: 41775747
If the file system is NTFS then you won't be having a file number problem with only 4.5 thousand files.  Limit is about 4 Gb.

You're also getting Access denied as well.

You might get someone in the programming forum to look at how you are opening and handling your files.
0
 
LVL 27

Expert Comment

by:davorin
ID: 41775812
Just adding to dbrunton's answer:
The only problem I have noticed with large number of files in a folder is slow browsing of folder contents. But the problem was starting to be noticeable at much higher number of files (cca. 100.000)
Have you compared the permissions on files you can and you cannot open?
0
 

Author Comment

by:shawn857
ID: 41777117
Thanks guys... well I don't think it's a files amount limitation now.... as a test I reduced the number of stock files I gather to around 2000 and I still get the problems. Here's the strange thing - it's *always* with two specific stock files that get created - AUX.txt and PRN.txt. Each are only about 30K big, but when I try to open them with plain ol' Notepad, they won't open and will show "Access Denied" (see screenshot "AccessDenied.jpg"). Every other one of those little stock files open up and display just fine.
   I checked the "Properties" of these troublesome files as compared to the other good ones - all the same checkbox settings, but one big difference, the troublesome files show 0 bytes as their file size... when in fact they are listed in Windows Explorer as around 28-30K (see attached screenshot "AUXproperties.jpg"). Very strange eh?

Thanks
    Shawn
AccessDenied.JPG
AUXproperties.JPG
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 48

Accepted Solution

by:
dbrunton earned 500 total points
ID: 41777151
AUX and PRN are reserved words.  As well as COM1 and  LPT1.  You can't or shouldn't use them for file names or derivatives of them.

See https://support.microsoft.com/en-us/kb/71843

This dates back to the DOS days when they were used for DOS commands.

If you can, alter your program to give them different names.  Like AUY.txt or PRM.txt.
0
 

Author Comment

by:shawn857
ID: 41777159
ahhhh, well isn't that lovely! Thank you for pointing that out to me, that never would've dawned on me! Dbrunton, I have been using a utility called "Unlocker" to manually delete these AUX.txt and PRN.txt files.... do you think that would have caused problems in my overall file structure on my disk?

Thanks!
   Shawn
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 41777173
No, you cannot create harm with this two names. Either operations work or fail straight.
Whether the reserved device names are read as such depends on internals. But as said, better to prevent from using them.
0
 
LVL 48

Expert Comment

by:dbrunton
ID: 41777198
>>  Do you think that would have caused problems in my overall file structure on my disk?

Unlikely.

Run chkdsk if you think you have file structure problems on the disk.
0
 

Author Comment

by:shawn857
ID: 41777247
OK thanks, I will do a chkdsk.

Knowing what the problem is now, I'm wondering how I can work around it. The file AUX.txt needs to be read by my little analysis program I wrote, but can't be read while it is named as AUX. I just tried manually renaming the file to something else (ie. AUX1.txt), but it won't allow it - says "Cannot rename: access is denied". My thinking was that if I could manually rename it to something like AUX1.txt, then I could hard-code my little program to treat AUX1.txt as simply AUX.txt... but doesn't look like that's going to work. It seems that as it stands, that AUX.txt file is not accessible, or renamable in any way... is that correct?

Thanks
   Shawn
0
 
LVL 48

Expert Comment

by:dbrunton
ID: 41777282
Correct.

Stuff to try.  

See if you can make a copy of the file as AUY.txt.   Never have AUX (or a reserved word) as part of the file name.  Then see if you can read the contents of AUY.txt.  If you can't then see if you can change the attributes of the file (possibly permissions as well but don't know under Windows).  Attributes to remove will be R and S.  Then try your reading of the file (AUY.txt).
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 41777702
Prepend "\\?\" to your full path, like in "\\?\C:\Temp\EE\AUX", to access the file (that is called "Redirector path").
Note: You cannot use the path in Explorer's address bar, as that resolves back to the conventional address, and you are at square one. But you can create, delete etc. the file whenever you are able to provide the full path including file name as a whole.
0
 

Author Comment

by:shawn857
ID: 41778919
Qlemo, thanks for the suggestion... but I think I will just go the easy way out and exclude those stock files completely from my creation - AUX.txt and PRN.txt. It's only 2 in a universe of thousands, I can do without them..

Thanks all for responding!

Cheers
   Shawn
0
 

Author Closing Comment

by:shawn857
ID: 41778921
Thanks!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
My Documents Sync to shared location 4 86
Event ID: 7016 / Source: Microsoft-Windows-GroupPolicy 7 132
how to copy from computer to usb drive 7 124
extend monitor issues 6 46
It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question