[jawsscripts] Re: Problems with Read and Write Ini functions

  • From: "David Pinto" <davepinto@xxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Fri, 20 Jan 2012 21:04:40 -0800

Dang,

The failure occurs when you have 2 instances of a same-named ini file. And 
one file is one directory, and the other in another directory. For instance, 
2 files named Students.ini. Where the path to the first one is, 
C:\HighSchool\Students.ini. And the path to the second one is, 
C:\Elementary\Students.ini.
If you follow the steps below, you will encounter 2 failures. First, there 
will be the failure to create the second folder and file. But then we'll 
reboot JAWS, and successfully create that second folder. But then the second 
failure will be a failure to write to one of the 2 existing ini files. But 
once again, we'll reboot JAWS, and successfully write to the ini file.  So, 
Here's how to duplicate the above.

1. Create the first folder and file via IniWriteString (aSectionName, aKey, 
theKeysValue, HighSchoolPath)
2. Now try creating the second folder and file via IniWriteString 
(aSectionName, aKey, theKeysValue, ElementaryPath).
3. Now open Explorer. You will not find the Elementary folder and its file. 
You will only find the HighSchool folder there.
4. Now reboot jaws, and again run IniWriteString (aSectionName, aKey, 
theKeysValue, ElementaryPath).
5. Now open Explorer and you will see that the Elementary folder and its 
Students file were successfully created.
6. OK. Now that you have created both folders and files, you're about to see 
once again how a path gets stuck in JAWS, or Windows, memory. So, in the 
file in the Elementary folder that you just created, write a value to the 
key.
7. In Explorer, open the file, and you will see that the value was written 
successfully.
8. But now in the HighSchool Folder, write a different value to the key in 
the Students file.
9. Now in Explorer, open up the Students file in the HighSchool folder, and 
you will not see that new value. It failed to write.
10. Here's the worst part. Go check out the file in the Elementary folder, 
and lo and behold! you will find that the second write that was aimed for 
the Students file in the HighSchool folder, was actually written to the 
students file in the Elementary folder.
11. Reboot JAWS, and once again write to the File in the High school folder. 
You will find success.

David

----- Original Message ----- 
From: "Dang Manh Cuong" <dangmanhcuong@xxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Friday, January 20, 2012 7:36 PM
Subject: [jawsscripts] Re: Problems with Read and Write Ini functions


> Could you give your script here? I always use ini functions to add, remove 
> hotkey for alot of jkm files and didn't see any errors like that
> ________________
> Dang Manh Cuong
> HCMC University of Pedagogy:
> The Psychology and education
> Mobile: +84 902-572-300
> E-mail: dangmanhcuong@xxxxxxxxx
> Yahoo ID: manhcuong0312
> Skype name: dangmanhcuong
> facebook: http://facebook.com/dangmanhcuong
> Blog: http://vi.netlog.com/Cuong_littlecat
> Website: http://ngoisaodanduong.com
> http://www.saomaicenter.org
> Projec-Website: http://code.google.com/p/dangmanhcuong
>  ----- Original Message ----- 
>  From: David Pinto
>  To: jawsscripts@xxxxxxxxxxxxx
>  Sent: Friday, January 20, 2012 8:36 AM
>  Subject: [jawsscripts] Problems with Read and Write Ini functions
>
>
>  There have been discussions on this list about different circumstances 
> where
>  JAWS ini functions are unreliable. I recently scoped out one particular
>  circumstance where these functions fail entirely, or actually write to 
> the
>  wrong file. The problem occurs when the following 2 conditions are met.
>  1. The ini functions are called 2 or more times consecutively but on
>  different files. And 2. The different files have the exact same name, but
>  they are in different folders. Here are the details along with some
>  examples:
>
>  If you write to an existing INI file in an existing folder path, and then
>  try writing to a same-named INI file in a different folder path, there 
> will
>  be a failure to write to that second same-named INI file. Instead, what
>  happens is that the first written INI file is written to.  For instance:
>  1. Write to the file <Anatomy.ini> in the path <C:\Girls\Anatomy.ini>. 
> THIS
>  WORKS JUST FINE.
>  2. Next try writing to the same-named file <Anatomy.ini> that's in the 
> path:
>  <C:\Boys\Anatomy.ini>. THIS CONSISTENTLY FAILS. What happens is that 
> instead
>  of the Boys' INI file being written to, the Girls' INI file is written 
> to.
>
>  The exact same failure occurs if the folders don't exist and you're using
>  IniWriteString () to both create them and write to the INI file. For
>  instance:
>  1. Create and write to <C:\Girls\Anatomy.ini.>. THIS CREATES AND WRITES 
> JUST
>  FINE.
>  2. Next try to create and write to <C:\Boys\Anatomy.ini.>. THIS 
> CONSISTENTLY
>  FAILS TO CREATE THE NEW FOLDER PATH.
>  Instead, what happens is that the Anatomy.ini in the Girls folder is 
> written
>  to.
>
>  Finally, if you're merely wanting to create folders, the same behaviour
>  holds. If the last folder in the second path is the same name as the last
>  folder in the first path, then you can't create the second group of 
> folders.
>  For instance
>  1. Create and write to <C:\Parents\Students>. THIS CREATES THE FOLDERS 
> JUST
>  FINE.
>  2. Next try to create  <C:\Teachers\Students>. THIS CONSISTENTLY FAILS TO
>  CREATE THE NEW FOLDER PATH.
>
>  Note that this behaviour is not corrected by including the IniFlush ()
>  function, but it temporarily goes away by reloading JAWS.
>
>  On a different but related note. Sometimes when trying to manually delete
>  one of those newly JAWS' created folders, Windows says "You need 
> permission
>  to perform this action" But if you shut down JAWS, deletion is 
> successful. I
>  haven't rigourously tested this out yet, so I can not duplicate the 
> failure
>  every time.
>
>  David Pinto
>
>
>  __________�
>
>  View the list's information and change your settings at
>  //www.freelists.org/list/jawsscripts
>
> __________�
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>
> 


__________�

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts: