trouble with IniDeletePVTFunction if EXE is running on a USB-stick

Started by Beat, August 12, 2018, 05:32:23 AM

Previous topic - Next topic

Beat

Hello all,
I'm really confused, once more!

I compiled my script to a EXE file with success and it works perfect if it is running on my HDD (C:\wherever....) or on a mapped drive and also if I start it from UNC-Parth.If the EXE is located on a USB-Stick (USB 2.0) it start running and it works mostly good, but if I delete a keyword with "IniDeletePvt" in my INI File it make a mistake. (It write a parth of the last "IniWritePvt" command in the ini-file). The defined keyword is korrect deleted, but it is also a keyword added. :( ??? :-\
Is something noted with timing problems if USB 2.0 Sticks are involved??
Best Regards from good old Switzerland

Beat
 
si tacuisses, philosophus mansisses!! ;-)
if you had remained silent, you would have continued to be a philosopher!!
Wenn du geschwiegen hättest, wärst du ein Philosoph geblieben!!

td

Just a guess but there is some possibility that this is a "timing" issue.  "Ini" files are special to the OS and are treated differently than other files. One of the differences is that they are cached in memory.  This means it is possible to write to the cached version and not have it reflected in the file system version until the cached version is flushed to disk.  However, this is usually only an issue when you have two different processes editing the file and it is not clear from your description that this is the case here.

As an experiment, you could clear the cached version before you perform your delete operation.  To clear the cached version do the following as describe in the Consolidated WIL Help file:

Code (winbatch) Select
IniWritePvt("","","",filename)



"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

Beat

Hello td,
I'm back with feedback, but first of all thank's for help.
It seem to be a problem between my USB Stick and my computer. I don't know why but my stick with a other computer and the program run's perfect. A other stick and my computer the program also run's perfect....
However i will change my stick and the problem is fixed.

PS: Of course i tested also your indication with
Code (winbatch) Select
IniWritePvt('','','',filename) but it was the same as it was before.

Best regards from good old SwitzerlandBeat
si tacuisses, philosophus mansisses!! ;-)
if you had remained silent, you would have continued to be a philosopher!!
Wenn du geschwiegen hättest, wärst du ein Philosoph geblieben!!

td

IIRC, there are two or three USB hub manufactures and they all don't always consistently play nice with all flash drive memory controllers.  But I think that it is less of an issue that it was a few years ago.  And of course, flash drives do not last forever. 
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade