From owner-freebsd-questions Fri Nov 19 11: 2: 2 1999 Delivered-To: freebsd-questions@freebsd.org Received: from fly.lglobus.ru (fly.lglobus.ru [195.34.224.130]) by hub.freebsd.org (Postfix) with ESMTP id 58D8B14E0E for ; Fri, 19 Nov 1999 11:01:52 -0800 (PST) (envelope-from rover@fly.lglobus.ru) Received: (from rover@localhost) by fly.lglobus.ru (8.9.3/8.9.2) id WAA68877; Fri, 19 Nov 1999 22:03:39 +0300 (MSK) (envelope-from rover) Date: Fri, 19 Nov 1999 22:03:38 +0300 From: "Oleg V. Volkov" To: Greg Lehey Cc: freebsd-questions@freebsd.org Subject: Re: Is there correct way for program to read from itself? Message-ID: <19991119220338.B68540@fly.lglobus.ru> Reply-To: rover@lglobus.ru References: <19991118065815.B89755@fly.lglobus.ru> <19991118102421.09370@mojave.sitaranetworks.com> <19991118223426.A62913@fly.lglobus.ru> <19991118152324.37840@mojave.sitaranetworks.com> <19991118232846.A63288@fly.lglobus.ru> <19991118154736.22915@mojave.sitaranetworks.com> <19991119002759.B63288@fly.lglobus.ru> <19991118172315.02758@mojave.sitaranetworks.com> <19991119012822.A63914@fly.lglobus.ru> <19991119111026.11577@mojave.sitaranetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i In-Reply-To: <19991119111026.11577@mojave.sitaranetworks.com> Organization: -=/ SR 13 /=- Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Nov 19, 1999 at 11:10:26AM -0500, Greg Lehey wrote: > >>>>>>>>> Is there correct way for porgram to read from it's own file? > >>>>>>>> I'm not sure I understand. What do you mean by "it's own file"? > >>>>>>>> If you mean the object file, sure. Where's the problem? > >>>>>>> I mean this situation: > >>>>>>> I have some program /usr/local/bin/someprog. Is there a way for it > >>>>>>> to read from itself (from /usr/local/bin/someprog). > >>>>>> Sure, that's what I said. What do you expect to find? > >>>>> Could you give me short example? > >>>> OK, here's copyme.c: > > [skip] > You still haven't answered my question: What are you trying to do, and > why? Did you hear of executable compressor named "UPX"? Recently version was made for Linux, and i wish to help author with enough info to make it work under FreeBSD without recompiling it. Soon, when they release 1.0 with sources this problems will go away by themselves. -- Oleg V. Volkov aka Rover EH: LCM Rover Join Elite Imperial Fleet! http://www.emperorshammer.org E-mail redirector: sr-13@mail.ru (always up) -=/ SR 13 /=- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message