-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 At some point hitherto, John Abreau hath spake thusly: > You said "under some circumstances"; can you expand on that? When > would it *not* work? I'm unfamiliar with a lot of the more advanced uses of GDB, but in addition to the author's response, I can think of one more case where I believe this will not work: where there are no streams involved. freopen() opens a file, and reassociates the stream given as the last argument with that file. If the file was opened with open(), there is no stream to associate. What I'm not clear on is whether or not some trickery can be done to do fdopen() followed by freopen(). If this is possible, it might work. But I don't know how one would take the resulting stream pointer (from the call to fdopen()) and pass it to the subsequent call to freopen()... First off, the pointer would (I think) have to already exist in the program space, which is probably unlikely, or in many cases impossible to determine. Secondly, whatever value it contained would have to be irrelevant to the rest of the execution of the program, since you're going to modify it. Then, maybe, you could pass it as an argument to freopen()... Yes? - -- Derek Martin ddm@pizzashack.org - --------------------------------------------- I prefer mail encrypted with PGP/GPG! GnuPG Key ID: 0x81CFE75D Retrieve my public key at http://pgp.mit.edu Learn more about it at http://www.gnupg.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8/pHYdjdlQoHP510RAsD9AJ4xknfNpuiU31k0XdjmxmW+E9bCgACdHvyp uTUL1QCPkitSu4wDsuL54Xc= =DIJ1 -----END PGP SIGNATURE-----