Re: File Copy

2008-11-24 Thread James G. Sack (jim)
Michael Wood wrote: > On Mon, Nov 24, 2008 at 10:34 PM, James G. Sack (jim) <[EMAIL PROTECTED]> > wrote: > [...] >> ==> FYI add_classpath works fine. >> As a curiosity, I notice that (System/getProperty "java.class.path") >> does not reflect any change after add-classpath. >> ==> I wonder if this

Re: File Copy

2008-11-24 Thread Michael Wood
On Mon, Nov 24, 2008 at 10:34 PM, James G. Sack (jim) <[EMAIL PROTECTED]> wrote: [...] > ==> FYI add_classpath works fine. > As a curiosity, I notice that (System/getProperty "java.class.path") > does not reflect any change after add-classpath. > ==> I wonder if this is as it should be? And if so,

Re: File Copy

2008-11-24 Thread James G. Sack (jim)
Stuart Sierra wrote: > Ok, first you need to add the commons-io.jar to the Java classpath. > You can do this by editing the Clojure startup script. The argument > to "-cp" is a colon-separated list of directories and/or JAR files to > go on the classpath. So if the command line was this: > >

Re: File Copy

2008-11-24 Thread Stuart Sierra
Ok, first you need to add the commons-io.jar to the Java classpath. You can do this by editing the Clojure startup script. The argument to "-cp" is a colon-separated list of directories and/or JAR files to go on the classpath. So if the command line was this: java -cp /path/to/clojure.jar c

Re: File Copy

2008-11-24 Thread James G. Sack (jim)
Parth Malwankar wrote: > > > On Nov 24, 12:34 am, Stuart Sierra <[EMAIL PROTECTED]> > wrote: >> Honestly, for this kind of low-level stuff I always use the Apache >> Commons libraries, , esp. the Lang and IO >> components. They've got every imaginable stream function

Re: File Copy

2008-11-23 Thread Parth Malwankar
t buffer 0 len) (recur (.read in buffer)) Parth > > On Nov 23, 1:35 pm, Parth Malwankar <[EMAIL PROTECTED]> wrote: > > > Hello, > > > I am trying to translate the following Java > > snippet into a file copy routine in Clojure. > > >

Re: File Copy

2008-11-23 Thread Stuart Sierra
jure, loop/recur is the way, as James demonstrated. -Stuart Sierra On Nov 23, 1:35 pm, Parth Malwankar <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to translate the following Java > snippet into a file copy routine in Clojure. > >   public static void copy(Inp

Re: File Copy

2008-11-23 Thread James Reeves
On Nov 23, 6:35 pm, Parth Malwankar <[EMAIL PROTECTED]> wrote: > I am trying to translate the following Java > snippet into a file copy routine in Clojure. > >   public static void copy(InputStream in, OutputStream out)    throws > IOException { >     byte[] buffer = new

File Copy

2008-11-23 Thread Parth Malwankar
Hello, I am trying to translate the following Java snippet into a file copy routine in Clojure. public static void copy(InputStream in, OutputStream out)throws IOException { byte[] buffer = new byte[1024]; while (true) { int bytesRead = in.read(buffer); if (bytesRead