Hello,

I only had time now to look at this.

I am running Ubuntu 10.04 LTS "Lucid Lynx" and on my machine running the tangle program had always the effect that the clojure.pamphlet file was reduced to file size 0.

Looking ad the man page for the open system call (man 2 open) says that there is no version of the open system call with only one parameter. I've modified the tangle program and now its working.

I've attached the patch.

I cannot imagine that I am the only one with that problem. Am I?

Thanks,
Christian

daly wrote:

On Wed, 2011-03-23 at 00:31 -0700, Christian Schuhegger wrote:
Does a public repository exist (e.g. on github) where people could
clone the repository and potentially contribute?



There is no repository. Everything (including all of the runnable
source) is in a single book. To build a running Clojure REPL and
a PDF copy of the book do:

wget http://literatesoftware.com/clojure.pamphlet
wget http://literatesoftware.com/tangle.c
     (the tangle.c source is also in the book so you could extract
      it from the pamphlet file instead)
wget http://literatesoftware.com/clojure.pdf
     (not really necessary as the next step will create the pdf
      but you might want to read it first)
gcc -o tangle tangle.c
tangle clojure.pamphlet Makefile>Makefile
make

You end up with a running Clojure REPL and a PDF of the book.

To make changes just modify the clojure.pamphlet file and type
make

You can send me your complete changed version or do
diff -Naur clojure.pamphlet.original clojure.pamphlet.new>clojure.patch

The basic philosophy of literate programming is that you
are writing for other people, not for the machine. This book
is an attempt to make the Clojure source code readable by
more people. What we are trying to do is start from the ideas
and move to the code so people understand why the code does
what it does.

Tim Daly






--
Christian Schuhegger
http://www.el-chef.de/

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- orig/tangle.c	2011-02-16 15:18:40.000000000 +0100
+++ tangle.c	2011-03-25 19:37:30.035951116 +0100
@@ -3,6 +3,8 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
+#include <sys/types.h>
+#include <fcntl.h>
 
 #define DEBUG 0
 
@@ -134,7 +136,7 @@
     perror("Usage: tangle filename chunkname");
     exit(-1);
   }
-  fd = open(argv[1]);
+  fd = open(argv[1], O_RDONLY);
   if (fd == -1) {
     perror("Error opening file for reading");
     exit(-2);

Reply via email to