Page 1 of 1 1
Topic Options
#47724 - 2003-11-11 07:48 PM ReadProfileString vs WriteProfileString visavis File Contention
Shawn Administrator Offline
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 Offline
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
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#47726 - 2003-11-11 07:55 PM Re: ReadProfileString vs WriteProfileString visavis File Contention
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Sorry for hijaaking this thread but you had it coming after that vis-a-vis thing! [Razz]

k, so I thought I'd use my trusty babelfish to translate it for you, and this is what it came up with:

"live has screw"

ROFLMAO [Big Grin] [Big Grin] [Big Grin]

[ 11. November 2003, 19:58: Message edited by: Les ]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#47727 - 2003-11-11 07:57 PM Re: ReadProfileString vs WriteProfileString visavis File Contention
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
It's actually vis-a-vis and it's French
quote:
Main Entry: 1vis-à-vis
Pronunciation: 'vEz-&-'vE, "vEs- also -ä-'vE
Function: preposition
Etymology: French, literally, face-to-face
Date: 1755
1 : face-to-face with
2 : in relation to
3 : as compared with

I'd say that READPROFILESTRING opens the file in read-only mode and does not emply file-locking mechanisms in order to prevent writes from other connections.

Anyway, I never had problems using .INI files for read-operations.
_________________________
There are two types of vessels, submarines and targets.

Top
#47728 - 2003-11-11 08:24 PM Re: ReadProfileString vs WriteProfileString visavis File Contention
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
live has screw - ROFLMAO

Ok - so I'm feeling pretty good about this then. We're going to have boat-loads (thousands) of users hitting this INI file in the morning, all at the same time (samosamo) so based on feedback thus far, should never have an issue. Thanks.

Top
#47729 - 2003-11-11 08:32 PM Re: ReadProfileString vs WriteProfileString visavis File Contention
Howard Bullock Offline
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?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#47730 - 2003-11-11 08:49 PM Re: ReadProfileString vs WriteProfileString visavis File Contention
Shawn Administrator Offline
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 Offline
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.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#47732 - 2003-11-11 09:05 PM Re: ReadProfileString vs WriteProfileString visavis File Contention
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
You know what - that's a fantastic idea.

I'm going to build that into my design ! Cache the script on the wkstn and run it locally. Check for updates (which is rarely) and re-fresh as required. Beautiful.

hmmm, security, have to think about that one. This whole desktop icon thingy was meant for cosmetics mostly, but there are some sensitive registry settings that are done through GROUPIT ...

[ 11. November 2003, 21:08: Message edited by: Shawn ]

Top
#47733 - 2003-11-11 09:52 PM Re: ReadProfileString vs WriteProfileString visavis File Contention
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Heck HB with AD and GPO the desktop gets hit by large files every logon every day anyways. AD should also give a local logon server with high speed access. .INI can only be up to 64K Yes maybe a little bit of a pain for dialup, but you could check that and not do on them if wanted as well.

Just my .02 cents. In the 10MB or less Network environment you might have to really consider it, but for 100MB LAN it should really not be an issue in my opinion.

Top
#47734 - 2003-11-11 09:58 PM Re: ReadProfileString vs WriteProfileString visavis File Contention
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
oh cripes Ron, I forgot about that 64kb limit - don't think it will be an issue but big thanks for reminding me.
Top
#47735 - 2003-11-12 02:54 AM Re: ReadProfileString vs WriteProfileString visavis File Contention
MCA Offline
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.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 515 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.19 seconds in which 0.105 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org