OpenPreferences() -- Readonly?

Windows specific forum
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

OpenPreferences() -- Readonly?

Post 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..
User avatar
TomS
Enthusiast
Enthusiast
Posts: 342
Joined: Sun Mar 18, 2007 2:26 pm
Location: Munich, Germany

Re: OpenPreferences() -- Readonly?

Post by TomS »

I can't confirm your problem.
I can open the same preference file as many times as I like.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4997
Joined: Sun Apr 12, 2009 6:27 am

Re: OpenPreferences() -- Readonly?

Post by RASHAD »

What about SetFileAttributes(Filename$, Attributes) ?
Or
Search for Open file as shared by mk-soft
Egypt my love
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: OpenPreferences() -- Readonly?

Post 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.
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: OpenPreferences() -- Readonly?

Post by DoubleDutch »

Yes, a flag for opening read only would be good.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
TerryHough
Enthusiast
Enthusiast
Posts: 781
Joined: Fri Apr 25, 2003 6:51 pm
Location: NC, USA
Contact:

Re: OpenPreferences() -- Readonly?

Post by TerryHough »

DoubleDutch wrote:Yes, a flag for opening read only would be good.
Post Reply