* UNIX resource compiler???
@ 1999-01-31 23:58 Nikolas Kauer
1999-01-31 23:58 ` Todd Vierling
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Nikolas Kauer @ 1999-01-31 23:58 UTC (permalink / raw)
To: egcs
Do you know of somebody who has written something like a
resource compiler for Unix executables (NOT Win32 or Mac)?
I would like to include about 100 text files with data as
an object file in my Unix (Linux, OSF, etc.) executable/library
and somehow "open" those compiled files for read in my main
program. This would be a mile stone for the specific application
in high energy physics I'm working on, but I could imagine this
could be very useful in many other situations.
This appears to be a common technique for Windows based applications,
however, I couldn't find such a resource compiler for Unix executables
(there is probably no defined interface for Unix). Unfortunately, I
lack the knowledge to design a simple interface for Unix. Hints to
resources where I could learn more about the structure of Unix executables
would also be greatly appreciated. Maybe there is a simpler method to
bind resources to executables in Unix that I'm not aware of.
If you know something. please let me know.
Nikolas Kauer
PS I'm not on the mailing list.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: UNIX resource compiler???
1999-01-31 23:58 UNIX resource compiler??? Nikolas Kauer
@ 1999-01-31 23:58 ` Todd Vierling
1999-01-31 23:58 ` Alfred Perlstein
1999-01-31 23:58 ` Martin v. Loewis
2 siblings, 0 replies; 5+ messages in thread
From: Todd Vierling @ 1999-01-31 23:58 UTC (permalink / raw)
To: Nikolas Kauer; +Cc: egcs
On Fri, 1 Jan 1999, Nikolas Kauer wrote:
: Do you know of somebody who has written something like a
: resource compiler for Unix executables (NOT Win32 or Mac)?
: I would like to include about 100 text files with data as
: an object file in my Unix (Linux, OSF, etc.) executable/library
: and somehow "open" those compiled files for read in my main
: program.
What you're not specifying is the actual purpose you have behind doing this.
If it's what I think it is, look at <nl_types.h> and the manual pages for
nl_types, catopen, catgets, and gencat (depending on your system, these may
be separate pages or combined, and not all may exist).
This is a method for number-indexing textual messages that can be used in a
fast manner, and it is XPG-specified (thus is available on most modern
operating systems). Almost all implementations actually mmap() the data
file, so it is rather zippy.
--
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: UNIX resource compiler???
1999-01-31 23:58 UNIX resource compiler??? Nikolas Kauer
1999-01-31 23:58 ` Todd Vierling
@ 1999-01-31 23:58 ` Alfred Perlstein
1999-01-31 23:58 ` Martin v. Loewis
2 siblings, 0 replies; 5+ messages in thread
From: Alfred Perlstein @ 1999-01-31 23:58 UTC (permalink / raw)
To: Nikolas Kauer; +Cc: egcs
You may want to look at Berkeley db, or ldap. "altavista" is your friend
:)
Alfred Perlstein - Programmer, HotJobs Inc. - www.hotjobs.com
-- There are operating systems, and then there's FreeBSD.
-- http://www.freebsd.org/ 3.0-current
On Fri, 1 Jan 1999, Nikolas Kauer wrote:
>
> Do you know of somebody who has written something like a
> resource compiler for Unix executables (NOT Win32 or Mac)?
> I would like to include about 100 text files with data as
> an object file in my Unix (Linux, OSF, etc.) executable/library
> and somehow "open" those compiled files for read in my main
> program. This would be a mile stone for the specific application
> in high energy physics I'm working on, but I could imagine this
> could be very useful in many other situations.
>
> This appears to be a common technique for Windows based applications,
> however, I couldn't find such a resource compiler for Unix executables
> (there is probably no defined interface for Unix). Unfortunately, I
> lack the knowledge to design a simple interface for Unix. Hints to
> resources where I could learn more about the structure of Unix executables
> would also be greatly appreciated. Maybe there is a simpler method to
> bind resources to executables in Unix that I'm not aware of.
>
> If you know something. please let me know.
>
> Nikolas Kauer
>
> PS I'm not on the mailing list.
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: UNIX resource compiler???
1999-01-31 23:58 UNIX resource compiler??? Nikolas Kauer
1999-01-31 23:58 ` Todd Vierling
1999-01-31 23:58 ` Alfred Perlstein
@ 1999-01-31 23:58 ` Martin v. Loewis
1999-01-31 23:58 ` Alfred Perlstein
2 siblings, 1 reply; 5+ messages in thread
From: Martin v. Loewis @ 1999-01-31 23:58 UTC (permalink / raw)
To: kauer; +Cc: egcs
> Do you know of somebody who has written something like a
> resource compiler for Unix executables (NOT Win32 or Mac)?
Wine (Wine Is Not an Emulator) has a resource compiler for Windows
resources, which works on Unix. This is probably not what you want,
though.
If you just want to link the text files into the executable, why not
just convert them into character array and link them in?
If you want to modify the executable after it has been linked, you
need to deal with specific executable format. For ELF, there is an
established interface (libelf) for reading and writing sections.
Please note that it is typically non-trivial to get a file handle for
the executable that is just being executed, at least in a way that
works 100%. For example, the file being executed might already be
unlinked from the file system.
Regards,
Martin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: UNIX resource compiler???
1999-01-31 23:58 ` Martin v. Loewis
@ 1999-01-31 23:58 ` Alfred Perlstein
0 siblings, 0 replies; 5+ messages in thread
From: Alfred Perlstein @ 1999-01-31 23:58 UTC (permalink / raw)
To: Martin v. Loewis; +Cc: kauer, egcs
On Fri, 1 Jan 1999, Martin v. Loewis wrote:
> > Do you know of somebody who has written something like a
> > resource compiler for Unix executables (NOT Win32 or Mac)?
>
> Wine (Wine Is Not an Emulator) has a resource compiler for Windows
> resources, which works on Unix. This is probably not what you want,
> though.
>
> If you just want to link the text files into the executable, why not
> just convert them into character array and link them in?
>
> If you want to modify the executable after it has been linked, you
> need to deal with specific executable format. For ELF, there is an
> established interface (libelf) for reading and writing sections.
>
> Please note that it is typically non-trivial to get a file handle for
> the executable that is just being executed, at least in a way that
> works 100%. For example, the file being executed might already be
> unlinked from the file system.
most systems will allows this via /proc your milage may vary.
-Alfred
>
> Regards,
> Martin
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1999-01-31 23:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-31 23:58 UNIX resource compiler??? Nikolas Kauer
1999-01-31 23:58 ` Todd Vierling
1999-01-31 23:58 ` Alfred Perlstein
1999-01-31 23:58 ` Martin v. Loewis
1999-01-31 23:58 ` Alfred Perlstein
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).