troubleshooting Question

VF5 Getting "File does not exist"

Avatar of Dee
DeeFlag for United States of America asked on
FoxPro
6 Comments1 Solution104 ViewsLast Modified:
I am getting “File does not exist” when they definitely do exist.  I have tested this endlessly.
I am testing an app that has a list of Foxpro programs in a list box.  The user selects a a program and clicks the “Run” button.
All the test programs in the list are in the same directory.  It works(ed) for one program and not the others.
To verify the validity of the path and filename:
1)      I duplicated the file names (and path) in the list that won't work, with the same file name as the one does works.  Copy and pasted.  I still get "File does not exist".  I pasted back it back over to this same one that was working – it no longer works.

     2) Programmitically wrote the location and filename to a text box before the program tries to run it.  After getting "File Does Not Exist", I  copied and pasted the text box contents into file explorer.  It opens, every time.

   3) I removed the following from my code that I thought was triggering the "file does not exist" error:
            if empty(sys(2000,lcFilePath)) then
                lcMsg = lcFilePath + " does not exist"
                Messagebox (lcMsg)
               return
         endif

         The error still occurs.   So It is not my code that triggers "File does not exist".

    4)  I added back the above IF block with an added ELSE statement:
                  if empty(sys(2000,lcFilePath)) then
                      lcMsg = lcFilePath + " does not exist **** !!!"
                    Messagebox (lcMsg)
                  return
           else
               messagebox ("exists")
          endif

          This triggers "exists"! ….  followed by Foxpro generated message "File does not exist".  
   
    5)  I created a text file and entered the filename and location in the Foxpro table with my programs to determine if is just a problem with the prg files.  When I selected the text file in list box  and clicked the RUN button, instead of getting a file type error I was expecting, I get my "exists" message followed by Foxpro's "File does not exist" message.

         It was the Foxpro "File does not exist"  message all the time - not mine.  It never hits mine when a file really does not exist.
>>>>>>>>>>
lcFilePath = alltrim(thisform.lstProcs.List[lcIndex, 2])       

lcProcName = alltrim(thisform.lstProcs.List[lcIndex, 1]
lcFilePath = lcFilePath + “\” + lcFilePath
 do &lcFilePath with &lcParams

I have also tried using the literal file path and name:
        Do “TheFilepath” + “\” to “ProcName.prg”
         Same.   “file does not exist”
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros