Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for Folder existence using FILE()
Message
De
18/09/2001 07:44:22
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
18/09/2001 07:29:28
Mark Brittell
NYS Department of Taxation and Finance
Schenectady, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00557314
Message ID:
00557701
Vues:
8
>>>>>Windows 2000 is being installed onto laptops in our office and we have not had an opportunity to convert all out applications to VFP. We have used the FILE() function to determine the existence of a folder using the NUL device reference. This is not working on the Win2000 laptops. We are aware that ADIR() will work but would like to find a way to have the FILE() function work without having to change and recompile our applications. Any advice would be appreciated.
>>>>>
>>>>>Thanks
>>>>>
>>>>>Mark Brittell
>>>>>NYS Department of Taxation and Finance
>>>>
>>>>Mark,
>>>>Except for writing an asm routine AFAIK adir() is the only reliable function to determine existence of a folder under fox2x.
>>>>Cetin
>>>
>>>Thankyou everyone for your responses. I think Cetin is right that the only way to do this is to write an .asm . I was hoping that we wouldn't have to do that or rewrite and recompile our code in 2.x to fix the problem. FYI the applications were originally written in versions of FoxPro before ADIR() was available which on reflection would have been the most appropriate choice when we converted these applications to 2.x but heck IT WAS working....
>>>
>>>Mark
>>
>>Mark,
>>As Sergey said you'd change your checks to something like IsDir(lcPath).
>>I meant asm was exception, if you don't need special folders that adir() can't access than go with adir(). ie (w/o error checking):
>>
>>
function IsDir
>>lparameters tcPath
>>private lnFiles
>>lnFiles = adir(arrDummy,tcPath+'\*.*','D')
>>return lnFiles > 0 and arrDummy[1,1]='.' and 'D'$arrDummy[1,5]
>>Cetin
>
>Thanks Cetin...I didn't think about all the checks you have on the return statment. Seems to cover it all though... Looks like this is what we can use until the application is converted...
>
>BTW...What special folders can't adir() access?
>
>Mark

Mark,
I meant error checks on passed parameter such as it has an ending '\' or not. Return part is OK.
Forget about special folders. I overlooked it can in fact :)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform