From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

network exist function & UIEIOError

Well, just when I thought I was out of the woods, I have Ini_WriteToFile errors again.  My app runs in a network environment.  You can read about my first run-in here.  That time, it was all about the instrument driver's temp file, and the other client computers trying to overwrite each others' file.  The error then was UIETooManyFilesOpen.

 

And now, all of a sudden, it's UIEIOError (Input/Output error).  Why?  What changed?  Not much on the topology end.  I've added a bunch more client machines to this same network, none of which have access to the destination directory that my INI driver is trying to write to.  And even more troubling, when we are getting these errors, it is bringing down the entire application.  I have the ConfigCVILogging.exe tool running on all my client machines to try to catch any other errors, but the most I see are some TCP/IP things.

 

So in the interest of fixing this soon, I'm entertaining a different writing scheme. Now I want to copy the file from the server, do all the editing and writing locally, then at the end copy it back to the server with a CopyFile.  This way, I have the best possible scenario for successful INI writing, and minimize the amount of network access by several orders of magnitudes.

 

The critical step in my app is to gaurantee that locally I have the most recent copy of the server's INI.  So at the beginning of this process I do this:
 

serverStatus = FileExists(serverFileName, 0);

FileExists gives either True, False, or (presumably) FmtIOErrType.  In a test, I yanked my ethernet cord and attempted the function call but simply got a 0, because the mapped network drive didn't resolve.  This is a problem.

 

Is there such thing as a PathExists function?  I need to know, at the time of reading the latest INI file and the time of writing my local copy back out, that the network connection is good.  I saw this post, but it doesn't look quite what I'm after.

0 Kudos
Message 1 of 2
(3,467 Views)

I did find that the function MakeDir will generate an error '-9' if "Directory or file already exists with same pathname."  This works well enough for my use.

0 Kudos
Message 2 of 2
(3,421 Views)