[M3devel] finding a file
Randy Coleburn
rcoleburn at scires.com
Sat Nov 7 21:34:12 CET 2009
Sounds like a job for bundles.
I use bundles a lot with FormsVBT and Trestle in Modula-3. The idea is that you create a bundle of the file(s) you need, but you code it so that you can override these bundled defaults by placing a real file in a certain location relative to the program binary.
If you want to see a code example, let me know and I'll send you something.
Regards,
Randy Coleburn
>>> <hendrik at topoi.pooq.com> 11/7/2009 9:38 AM >>>
I'm guessing there's probably a well-known, more-or-less standard way to
handle the following problem. So before I roll my own (not a difficult
task), I thought I'd ask what the normal techniques are, and
whether there are already ready-made tools for this somewhere in the
Modula 3 codebase.
I have a file that has to be read by a program under development.
Conceptually, the file is part of the program (it contains
boilerplate that has to be copied (at present, anyway; later I may
need to make substitutions) into the program's output).
The question is how to find it. So far I have two ideas.
(1) use a preprocessor to turn the file contents into the Modula 3
source code for a module with a humongous initialized character string.
How do I specify this in an m3makefile? It would have to be able to
compile the preprocessor as well as run it to create further Modula 3
code that it would then compile.
or
(2) Find a standard place for the file, possible relative to the
location of the executable. (At any time I may have several versions of
this code -- such as a production and a development version) Is there
well-known code for finding the executable?
or
(3) At compile time, have a parameter that gets copied into the
generated executable that says where these files will be at
execution time. But how to I embed compile-time parameters into
Modula 3 code?
-- hendrik
CONFIDENTIALITY NOTICE: This email and any attachments are intended solely for the use of the named recipient(s). This e-mail may contain confidential and/or proprietary information of Scientific Research Corporation. If you are not a named recipient, you are prohibited from making any use of the information in the email and attachments. If you believe you have received this email in error, please notify the sender immediately and permanently delete the email, any attachments, and all copies thereof from any drives or storage media and destroy any printouts of the email or attachments.
EXPORT COMPLIANCE NOTICE: This email and any attachments may contain technical data subject to U.S export restrictions under the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). Export or transfer of this technical data and/or related information to any foreign person(s) or entity(ies), either within the U.S. or outside of the U.S., may require export authorization by the appropriate U.S. Government agency prior to export or transfer. In addition, technical data may not be exported or transferred to certain countries or specified designated nationals identified by U.S. embargo controls without prior export authorization. By accepting this email and any attachments, all recipients confirm that they understand and will comply with all applicable ITAR, EAR and embargo compliance requirements.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20091107/72d1ff0c/attachment-0002.html>
More information about the M3devel
mailing list