Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for Folder existence using FILE()
Message
De
18/09/2001 00:58:19
 
 
À
17/09/2001 11:40:34
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:
00557649
Vues:
11
>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

This still works on my Win200 laptop:
*!***********************************************
*!
*!       Function: CHKDISK
*!
*!***********************************************
FUNCTION ChkDisk
PARAMETER cPath
IF DriveType(JustDrive(m.cPath)) # 2
	* Not a floppy drive, so return ok
	RETURN .T.
ENDIF
LOAD IsDiskIn
PRIVATE ok, cDrive, cPara
ok= .F.
cDrive= UPPER(LEFT(m.cPath,1))
DO WHILE ! m.ok
	cPara= m.cDrive
	CALL IsDiskIn WITH m.cPara
	ok= m.cPara # '0'
	IF ! m.ok ;
			AND MsgBox('Check that a formatted disk is in drive '+ m.cDrive + ':', ;
			'', 5+48)=2
		EXIT
	ENDIF
ENDDO
RELEASE MODULE IsDiskIn
RETURN m.ok

*!***********************************************
*!
*!       Function: CHKDIR
*!
*!***********************************************
FUNCTION ChkDir
PARAMETER cPath
IF ! ChkDisk(m.cPath)
	* test for drive first
	RETURN .F.
ENDIF
PRIVATE fp, cStr
cStr = AddBS(JustPath(m.cPath)) + 'T_821414.TMP'
fp = FCREATE(m.cStr)
IF m.fp # -1
	= FCLOSE(m.fp)
	ERASE (m.cStr)
	RETURN .T.
ENDIF
RETURN .F.
and you will need Foxtools loaded and IsDiskin.bin. I've still got these if you need theme.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform