Page 1 of 1

OpenPreferences() -- Readonly?

Posted: Fri Jul 01, 2011 3:56 pm
by jassing
Is there a way to open the preference file "readonly"?
What I'm after is to be able to launch multiple copies of an exe, and use the same ini file -- but since it's opened for read/write - only the 1st one can use it.
I know I can open/close the file at start; but his still leaves an opening for another copy to fail the open.
I haven't been able to get the windows createmutex() to work so that I can have a system-wide mutex; that was my 1st route..

Re: OpenPreferences() -- Readonly?

Posted: Sat Jul 02, 2011 8:54 pm
by TomS
I can't confirm your problem.
I can open the same preference file as many times as I like.

Re: OpenPreferences() -- Readonly?

Posted: Sun Jul 03, 2011 4:36 am
by RASHAD
What about SetFileAttributes(Filename$, Attributes) ?
Or
Search for Open file as shared by mk-soft

Re: OpenPreferences() -- Readonly?

Posted: Wed Jul 06, 2011 4:35 pm
by jassing
TomS wrote:I can't confirm your problem.
I can open the same preference file as many times as I like.
Hmm. very odd -- I create two exe's and they both attempt to open up the same ini file; the 2nd one is denied... Oh well.

Re: OpenPreferences() -- Readonly?

Posted: Sat Jul 09, 2011 8:28 pm
by DoubleDutch
Yes, a flag for opening read only would be good.

Re: OpenPreferences() -- Readonly?

Posted: Tue Jul 12, 2011 9:01 pm
by TerryHough
DoubleDutch wrote:Yes, a flag for opening read only would be good.