Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADIR, SYS(2000) and Filer all returned wrong results
Message
 
 
To
01/12/2006 14:31:33
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01173982
Message ID:
01174415
Views:
25
>Hi Naomi
>
>We use a folder populated by a process over which we have no control. This folder accmulates files for a month. At Month end, it typically has 100,000+ files.
>
>You can read about short file name generation here:
>http://www.microsoft.com/technet/prodtechnol/winxppro/reskit/c13621675.mspx#EEIBG
>
>In our scenario, we were masking on '1234*.dat' where the '1234' could vary. Because we had so many files and short file name creation was enabled on that server, there were short name collisions which resulted in only the first 2 characters of the file name preserved. I found a description of the issue and the resoultion but cannot find it now.
>
>Since we had no need for short file names, we simply disabled that feature (it is a registry setting).
>
>I just executed the following line against a folder with 117,614 files and short file names disabled:
>
>? adir(laFiles, 'q:\*p*.old')
>
>and it returned 82 files with 'p' file name stem.
>
>You can confirm if this is your issue by opening a command promp and issuing
>
>C:>dir *E*.jpg /x
>
>This will display both long and short file names. Here is an example from a server with short names enabled
>
>I issued 'DIR p*.old /x'
>here are the results. 4 files with no 'p' in the long name were created with a 'p' in the short name. Again, this folder has ~120,000 files.
>
>Volume in drive Q is hew
> Volume Serial Number is 5B02-B750
>
> Directory of Q:\
>
>10/27/2006 12:48a 15,592 P96A100~.OLD ac1310215.OLD
>10/31/2006 01:52a 30,200 PI08000~.OLD ac3210256.OLD
>10/31/2006 01:55a 7,540 PNOB000~.OLD ac4810264.OLD
>10/24/2006 01:15a 9,447 P71P000~.OLD ac6010136.OLD
> 4 File(s) 62,779 bytes
>
>If you simply issue 'DIR p*.old' you get
>
>Volume in drive Q is hew
> Volume Serial Number is 5B02-B750
>
> Directory of Q:\
>
>10/27/2006 12:48a 15,592 ac1310215.OLD
>10/31/2006 01:52a 30,200 ac3210256.OLD
>10/31/2006 01:55a 7,540 ac4810264.OLD
>10/24/2006 01:15a 9,447 ac6010136.OLD
> 4 File(s) 62,779 bytes
> 0 Dir(s) 19,949,154,304 bytes free
> 0 Dir(s) 19,949,166,592 bytes free
>
>So DIR and I suspect ADIR operate on short file names if they are present. It really only becomes a problem when a folder contains many files with similar names resultin in short file name collisions.
>
>
>HTH
>
>Bruce
>
Yes, this sounds exactly like our scenario. Thanks again for your help.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform