X-Spam-Check-By: sourceware.org X-IronPort-AV: i="3.99,313,1131339600"; d="scan'208"; a="147649935:sNHT24335646" To: cygwin AT cygwin DOT com Subject: executable = exe + data Mail-Copies-To: never Reply-To: sds AT gnu DOT org X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. From: Sam Steingold Mail-Followup-To: cygwin AT cygwin DOT com Date: Fri, 30 Dec 2005 00:00:35 -0500 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com CLISP consists of a run time (a normal executable lisp.exe, 2.5M) and a memory image (a binary data file lispinit.mem 2MB-10GB). It is normally invoked as "lisp.exe -M lispinit.mem", i.e., the application consists of two files instead of a single executable which is generally not considered desirable by the users, one of whom suggested the following: copy /y /b lisp.exe + marker.txt + lispinit.mem myapp.exe where marker.txt contains some marker test. so lisp.exe, when invoked without -M, will look at its own executable file and search for the marker text and use whatever it finds after that as the memory image (i.e., the -M file). This should work, but I would rather not search the executable for the marker text (for performance reasons - I do not want to increase the start-up time), I would prefer to know where the executable ends right away. Is it possible? simply put, it it possible to write something like this: int main () { size_t my_length; printf("exe size=%lld\n",my_length); return 0; } so that when it is compiled, my_length contains the length of the executable file as it was created by the compiler. e.g.: $ ./myprog.exe exe size=1234567 $ copy /y /b myprog.exe + myprog.exe myprog2.exe $ ./myprog2.exe exe size=1234567 -- and not 2469134 one of the main requirements is portability. (nothing woe32-specific or cygwin-specific &c) the only idea I have had so far is this: char string[]="this is a buffer into which I will be writing my stuff"; size_t my_length = atol(string); and then have a post-processor edit lisp.exe and replace the contents of string with the actual lisp.exe file length (I need the long initial junk there so that the post-processor will be able to find where it is to write the length). any suggestions? Thanks. PS. I understand that this is not cygwin-specific, so I would appreciate a pointer to the proper forum to ask this question. -- Sam Steingold (http://www.podval.org/~sds) running w2k http://www.honestreporting.com http://www.openvotingconsortium.org/ http://www.iris.org.il http://www.camera.org http://www.memri.org/ MS: Brain off-line, please wait. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/