#47724 - 2003-11-11 07:48 PM
ReadProfileString vs WriteProfileString visavis File Contention
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Sorry, ever since I saw the Architect in Matrix-reloaded, I always wanted to use the term "visavis" in a sentence - I have no idea what it means.
I want to clear-up something in my own mind, and ask anyone that is currently doing this to verify my assumptions.
Reading and writing to INI files during the login process.
We have always stated (warned) that WRITING to a common INI file during login can and may fail intermittently when two user's try to write to it at the same time, think we know this as a fact, ja ?
But - is it true that simply READING from an INI file definitely 100% does not cause this to happen. My assumption is that when Kixtart does an INI read, it opens the file read-only and does the read. If all user's are readiing it should never fail. If writing, it would quickly open the file for write, write, then close file. Thus, opportunity for collision.
Or - does it treat all IO as a potential write and open it read/write anyways. Can anyone that has much experience with just READING INI files during the login script share their experience ?
Is just reading bullet-proof ?
-Shawn
|
Top
|
|
|
|
#47725 - 2003-11-11 07:54 PM
Re: ReadProfileString vs WriteProfileString visavis File Contention
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
If you are reading from the NETLOGON share where only READ access is granted (in NT4) and to non-Admins in W2K, then no one can lock the file for writing.
I have an old post that goes into the INI Reading/Writing issues.
http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=2;t=003264#000000
|
Top
|
|
|
|
#47726 - 2003-11-11 07:55 PM
Re: ReadProfileString vs WriteProfileString visavis File Contention
|
Les
KiX Master
Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
|
|
Top
|
|
|
|
#47729 - 2003-11-11 08:32 PM
Re: ReadProfileString vs WriteProfileString visavis File Contention
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
How big is this file? Would you be better servers with subscripts named after the INI group headings?
|
Top
|
|
|
|
#47730 - 2003-11-11 08:49 PM
Re: ReadProfileString vs WriteProfileString visavis File Contention
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
The ini file is going to be quite large and complicated. It will be replacing an application (that coincidently I wrote) quite a few years ago, before INGROUP() was in Kixtart, called GROUPIT.
GroupIt is a quasi-scripting "language" (it reads a config file really) that controls which icons the user's sees on their desktop, based on Global Group membership ... it also "caches" the user's group membership in the registry (all our internal apps look to this) - the "script" looks like this (don't laugh):
code:
Group IT.BccsDskIntertel copylink "%links%\lwa\LWAnServord" "%internal%\Servord for Intertel" copylink "%links%\lwa\LWAnMax" "%internal%\Max Prime" copylink "%links%\lwa\LWAnSwitchView" "%internal%\Switchview" copylink "%links%\lwa\LWAnMVIData" "%internal%\MVI Data Unit" copylink "%links%\lwa\LWAnMVIAdmin" "%internal%\MVI Admin" Group IT.BccsDskWfms copylink "%links%\lwa\LWAnWFMS 613, 705" "%internal%\WFMS 613, 705" copylink "%links%\lwa\LWAnWFMS 519" "%internal%\WFMS 519" copylink "%links%\lwa\LWAnWFMS 416, 905" "%internal%\WFMS 416, 905"
It just parses from top to bottom saying "If the user is a member of group xxx, then copylink the shortcut from %LINKS%\... to certain desktop folders (copylink is an internal GROUPIT statment). Anyways like I said, this was written well before Kix had it's INGROUP function. I do want to retire GROUPIT and just use pure Kixtart scripting. Kixtart now has UDF support and much faster group enumeration.
Having said that, an INI file will replace this "script" ... the "group memberships" and shortcut dest/tgt pointers simply turned into INI values. But yeah Howard, it will be quite a large file.
-Shawn [ 11. November 2003, 20:56: Message edited by: Shawn ]
|
Top
|
|
|
|
#47731 - 2003-11-11 09:02 PM
Re: ReadProfileString vs WriteProfileString visavis File Contention
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Do you want that much network traffic at every logon? You could use 40K CRC32.exe to validate a local copy of your large file and then use it from the local HD only coppying it to the client if it needed updated or replaced as a result of tampering.
|
Top
|
|
|
|
#47735 - 2003-11-12 02:54 AM
Re: ReadProfileString vs WriteProfileString visavis File Contention
|
MCA
KiX Supporter
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear Shawn,
The limit of 64kb for INI files is mention many times, but we are using INI's above 256kb on our server without losing any information during the write operations. When you are loosing information on your server it has to deal with your server configuration. With slow servers we got damaged information in those files.
The local structure of collecting information we are also using by slow connections. During a reconnect with a fast connection all those information will transfer to the server. greetings.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 507 anonymous users online.
|
|
|