Newsgroups: comp.sys.amiga.tech Path: utzoo!utgpu!jarvis.csri.toronto.edu!dundas.csri!edgar From: edgar@csri.toronto.edu (Edgar LeBel) Subject: Re: Locking & forbiding Message-ID: <1989Jun12.085219.3799@jarvis.csri.toronto.edu> Organization: University of Toronto, CSRI References: <7cBq029532iy01@amdahl.uts.amdahl.com> <108333@sun.Eng.Sun.COM> <108749@sun.Eng.Sun.COM> <1aY.02kv33t701@amdahl.uts.amdahl.com> In article <1aY.02kv33t701@amdahl.uts.amdahl.com> dwl10@amdahl.uts.amdahl.com (Dave Lowrey) writes: >In article <108749@sun.Eng.Sun.COM> cmcmanis@sun.UUCP (Chuck McManis) writes: >>I wrote : >>>Why don't you use SetWindowTitle()? >> >>In article (Dave Lowrey) writes: >>>I need to get the address of the current title, as well as >>>setting a new title. >>> >>>So I guess I am asking if it is safe to access this info >>>without any locking. >> >>Hmmmm, why do I get the feeling that you aren't doing something that >>one my consider "normal" programming practice? :-) > >That's why I am asking these questions. I would like to remain >"normal" (Whatever that means). :-) > >> >>So to be completely blunt and open about this : >> >> You opened a window, so you have a pointer to the window... > >You assume wrong. The "shell" has opened the window, so I don't >own it. > >The program I am writing puts the Current Directory into the >title bar. It works now, without ANY locking, but I suspect that >I am inviting trouble by not preventing other processes from accessing >the data. > >-- >"What is another word | Dave Lowrey | [The opinions expressed MAY be > for 'Thesaurus'?" | Amdahl Corp. | those of the author and are not > | Houston, Texas | necessarily those of his > Steven Wright | amdahl!dwl10 | employer] (`nuff said!) In my own shell I have the current directory in the title bar, which I obtained "normally" without any locking. Just send an ACTION_DISK_INFO packet to intuition and get the window structure pointer from the id_VolumeNode field of the InfoData structure in the reply. I got this method from Chris Siebenman (thanks Chris) and it's been working for two years. If you would like a code fragment, send me mail. -- Hobie Orris impersonating Edgar Lebel edgar@csri.utoronto.edu