Welcome to MSDN Blogs Sign in | Join | Help

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.

 

 

 

 

 

 

 

 

Published Wednesday, October 26, 2005 12:21 PM by Calvin_Hsia
Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Why did I get an error while publishing Photos?

Friday, October 28, 2005 9:46 AM by Mike Yearwood
Hi Calvin

I reported something like that many years ago. If you USE \\SERVER\PATH\FILE.DBF EXCLUSIVE and then PACK. VFP used to report file not found. It was fixed as far as I know.

Mike

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker