viewpoint-particle

Author Topic: trouble with IniDeletePVTFunction if EXE is running on a USB-stick  (Read 309 times)

Beat

  • Newbie
  • *
  • Posts: 5
    • Camping Saland
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
 

td

  • Tech Support
  • *****
  • Posts: 2653
    • WinBatch
Re: trouble with IniDeletePVTFunction if EXE is running on a USB-stick
« Reply #1 on: August 12, 2018, 09:05:50 am »
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
IniWritePvt("","","",filename)



"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


Beat

  • Newbie
  • *
  • Posts: 5
    • Camping Saland
Re: trouble with IniDeletePVTFunction if EXE is running on a USB-stick
« Reply #2 on: August 18, 2018, 06:07:02 am »
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
IniWritePvt('','','',filename)
but it was the same as it was before.

Best regards from good old SwitzerlandBeat

td

  • Tech Support
  • *****
  • Posts: 2653
    • WinBatch
Re: trouble with IniDeletePVTFunction if EXE is running on a USB-stick
« Reply #3 on: August 20, 2018, 07:52:04 am »
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. 
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates