[Python-Dev] Sharing expat instances
Bob Ippolito
bob at redivi.com
Thu Dec 15 02:50:04 CET 2005
On Dec 14, 2005, at 5:31 PM, Alex Martelli wrote:
> On 12/14/05, Chris Lambacher <lambacck at computer.org> wrote:
>> Py2exe manages to load .pyd files and dlls from zip. Apparently
>> they have
>> written an alternate dll loader that does not need the file to be
>> on the file
>> system. This is used for single file apps.
>>
>> I don't know if it is possible to write a portable Unix equivalent
>> for .so
>> files.
>
> If you mean, portable to all dialects of Unix and Unix-like systems, I
> am pretty confident in answering "no". But it might be possible to
> support many such systems, e.g. by exploiting the DMG format ("disk
> image" within a single file), native to MacOSX, that can be used in
> Linux (and I believe in some other Unix variants) by mounting the file
> as a "loop device" (there's all sort of niggling issues, such as the
> need to be root to do so, but perhaps there might be workarounds...).
For Mac OS X 10.4+, you don't even have to bother. The dynamic
linker finally implements the function that lets you load a code
bundle straight from RAM:
extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromMemory(
const void *address,
size_t size,
NSObjectFileImage *objectFileImage);
Of course, you could always just use temporary files or a cache
somewhere.
-bob
More information about the Python-Dev
mailing list