Article View: comp.lang.modula2
Article #1620UNIX calls from Modula2 (HELP!)
From: Vinter Brian
Date: Sun, 16 Dec 1990 13:17
Date: Sun, 16 Dec 1990 13:17
49 lines
2006 bytes
2006 bytes
Hi netters,
I'm writing a Libary system in Modula2 running under UNIX, and my problem is as
follows:
From time to time users of the system is to use the mail facility in
UNIX, and to make this as comfortable as possible I'd like to use
emacs as editor for the letters. I use POpen to access emacs my
code is as follows:
MODULE test;
FROM UnixStdio IMPORT POpen,StdOut,PClose,StdErr,StdIn,Stream, FDOpen,
FOpen, GetChar, PutC;
FROM InOut IMPORT WriteString;
FROM Files IMPORT File,Create,textMode,replace,FileState;
FROM Terminal IMPORT SetEditMode, SetEchoMode, Tmode;
VAR b1,b2 : BOOLEAN;
status : FileState;
stream : Stream;
ch : CHAR;
BEGIN
b1:= FOpen("letter.txt","r+",stream);
b1:= POpen("emacs letter.txt","w",stream);
b2:= PClose(stream);
IF bol THEN WriteString("Opend")
ELSE WriteString("Not opend") END;
IF b2 THEN WriteString("Closed") ELSE WriteString("close failed"); END;
END test.
The problem is: emacs starts up nicely and because of the hybrid with r+ and
w it also retrieves chars allright, but it refuses to retrieve control
sequences so I'm stock.
The alternative is is to ask the user to wait 3 min. after ending his letter,
and then kill the job and use the backupfile, but that wont give me an A -:).
So if anybody got an idea how to do it, please give me a hint - as I have to
deliver th program on friday the 21 Dec.
Thanks in advance
vinter
alias Brian Vinter comp. ing. stud.
Technical Details
Message-ID:
<1990Dec16.131707.6666@iesd.auc.dk>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!dkuug!iesd!newsShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!dkuug!iesd!news From: vinter@iesd.auc.dk (Vinter Brian) Newsgroups: comp.lang.modula2 Subject: UNIX calls from Modula2 (HELP!) Message-ID: <1990Dec16.131707.6666@iesd.auc.dk> Date: 16 Dec 90 13:17:07 GMT Sender: news@iesd.auc.dk (UseNet News) Organization: CS and Math, University of Aalborg, Denmark Lines: 49