Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get FILE I/O ERROR when opening 2.6 file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00484477
Message ID:
00485103
Vues:
9
>>>>What could cause the FILE I/O ERROR when opening an FPW 2.6 screen file?
>>>>
>>>>No. The files are not read-only.
>>>>Yes, I can open the screen files as tables.
>>>>
>>>
>>>
>>>You have a removable drive in your machine without a disk in it (cdrom or zip drive or something like that). As well, one or more components of the screen are not where they screen thinks they should be, so it starts looking at each drive starting with c: until it either hits a spot where there is no drive. It will give you an error on any removable drive that does not have media in it. Just make sure you have something in all your removable drives when you open the screen. After editing it, it should be fine in the future. The way to prevent this is to set up your drive letters so there is a gap between your non-removable drives and the removables (ie: make the cdrom e: instead of d:) and the problem goes away.
>>
>>*Sometimes* skipping a drive letter worked. It seemed to be driver dependant. Sony drives seemed OK with the skip, Panasonic, did not, etc...
>
>I don't know. I never ran into one that didn't work, and actually the drives I was using at the time was a panasonic. I wonder if it was the driver for it? It was (in the old days) mscdex.exe that set the drive letter, and with windows95 it seems to work fine with every drive I have tried it with. That being said, there used to be an MS whitepaper on the issue and one of the recommended fixes was what I suggested. As well, I wrote code to fix the thing for our software because we didn't feel it was professional to make our users move their drive letters. The code I used is below.
>
>-> Cut Here
>* Program....: FIXAPP.PRG
>* Version....: 1.0
>* Author.....: Cy Welch
>* Date.......: April 29, 1997
>* Notice.....: Copyright (c) 1997 MetSYS Inc, All Rights Reserved.
>* Compiler...: FoxPro 5.0
>* Abstract...:
>* Changes....:
>
>PARAMETERS lcFileMask
>
>lnParm = PARAMETERS()
>IF lnParm = 1
> nCount = ADIR(aApps,lcFileMask)
> IF nCount > 0
> FOR nCurApp = 1 TO NCount
> WAIT WINDOW "Processing: "+aApps(nCurApp,1) NOWAIT
> DO fixpaths WITH aApps(nCurApp,1)
> ENDFOR &&* nCurApp = 1 to NCount
> ELSE
> WAIT WINDOW "Nothing Matches your FileMask, try again" TIMEOUT 25
> RETURN
> ENDIF
>ENDIF
>WAIT CLEAR
>CLOSE ALL
>
>************************************************************
>* Function....: fixpaths
>* Called by...:
>*
>* Abstract....: Fixes Paths in Apps to point to C:
>*
>* Returns.....:
>*
>* Parameters..:
>*
>* Notes.......:
>************************************************************
>FUNCTION fixpaths
>PARAMETERS cAppName
>PRIVATE cChar1, cChar2, cChar3, nReadPos
>STORE " " TO cChar1, cChar2, cChar3
>STORE 0 TO nReadPos
>nFile = FOPEN(cAppName,2)
>IF nFile > 0
> DO WHILE !FEOF(nFile)
> nReadPos = nReadPos + 1
> cChar = FREAD(nFile,1)
> cChar1 = cChar2
> cChar2 = cChar3
> cChar3 = cChar
> IF cChar2 = ":" .AND. cChar3 = "\" .AND. INLIST(UPPER(cChar1),"D","E","F","G","H","I","J","K","L","M","N",;
> "O","P","Q","R","S","T","U","V","W","X","Y","Z")
> = FSEEK(nFile,nReadPos -3)
> = FWRITE(nFile,"c")
> = FFLUSH(nFile)
> = FSEEK(nFile,nReadPos)
> STORE " " TO cChar1, cChar2, cChar3
> ENDIF && cChar2 = ":" .AND. cChar3 = "\"
> ENDDO && !FEOF(nFile)
> =FCLOSE(nFile)
>ELSE
> WAIT WINDOW "Warning: File Not Found:"+cAppName
> RETURN
>ENDIF && nFile > 0
>RETURN
>*EOF fixpaths

It may have been more driver related, because I've seen it both work/not work with exactly the same hardware and OS, but different machines. A similar program as yours cured the ills.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform