Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADIR, SYS(2000) and Filer all returned wrong results
Message
 
 
To
04/12/2006 10:15:30
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:
01174602
Views:
19
Bruce,

Thanks a lot again. I'm passing this info on.

I'm cc people who I think may be interested in this.

>Hi Naomi
>
>Here are the instructions:
>
>http://support.microsoft.com/kb/210638
>
>Short names should be disabled on the computer where the files are stored.
>
>According to the discussion here:
>
>http://help.lockergnome.com/windows2/Disable-automatic-creation-short-ftopict455345.html
>
>There are potential problems with disabling short file names, but we have not encountered any problems in 2 years. The Lockergnome discussion also mentions fsutil.exe as a way to disable short file name creation, but that is only available on Windows XP.
>
>Good luck!
>
>>Bruce,
>>
>>Just to clarify: the short names should be disabled on the server or on the workstations? Do you by any chance know which registry setting is responsible for that or is it an option in WE?
>>
>>Thanks a lot again.
>>
>>>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
>>>
>>>
>>>>>Hi Naomi,
>>>>>
>>>>>We encountered a similar problem using file masks on folders with > 10,000 files. The issue was related to short file names that were automatically generated. The short file name(8.3) matched the mask even though the long file name did not. We resolved by setting the registry key to disable short file name generation.
>>>>>
>>>>
>>>>Bruce,
>>>>
>>>>This is extremely important. Can you please elaborate a bit more? Also, are you confirming, that you indeed can use *letters*.ext as a mask for ADIR, etc. despite Sergey Karimov's comment?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform