Why did I get an error while publishing Photos?
I was publishing some photos/movies of my 27 month old son taking ski lessons (see Sharing Digital Pictures of your friend's ) and I received an unexpected error. I narrowed down the code to this fragment:
CPATH= "c:\inetpub\wwwroot\"
CREATE TABLE (CPATH+"temp") (name c(10))
APPEND BLANK
DELETE ALL
PACK
This is the error I receive File 'c:\inetpub\wwwroot\temp.dbf' does not exist.
Hmmm… I wondered what was going on. Upon further investigation, I could only reproduce the error on the VFP9 RTM build 2412, but not the latest internal build.
A little digging revealed the issue. When PACKing a table, a temporary virtual file is created into which the non-deleted records are copied. This virtual file is created with a temporary full path file name in the same directory as the table.
When the virtual file is closed after the PACK operation, it is converted from a virtual (in memory) to a real file. That folder happened to be marked as a System folder, and there was code that checked to see if the folder for the temp file existed. If not, it creates the real temp file in the current directory with a new temp name. The temp file is then renamed to be the original file. The rename fails if the directories are different. The code then tries to open the new file, which isn’t there.
The code to check if the folder existed did not check Hidden or System directories. I fixed that a few months ago.
Comments
Anonymous
October 28, 2005
Hi Calvin
I reported something like that many years ago. If you USE \SERVERPATHFILE.DBF EXCLUSIVE and then PACK. VFP used to report file not found. It was fixed as far as I know.
MikeAnonymous
August 04, 2008
PingBack from http://zachariah.freepicsinfo.info/foxprotempdbfdoesnotexist.htmlAnonymous
June 02, 2009
PingBack from http://woodtvstand.info/story.php?id=88927