Re: code review request: clojure.java.io

2010-06-25 Thread Chas Emerick
Sorry I'm so late to this particular discussion :-/ Why was to-byte-array left behind? It is a bit of an oddball function, insofar as it doesn't fit into IOFactory or Coercions, but seems to me like a natural cousin to copy. - Chas On May 11, 2010, at 12:16 PM, Stuart Halloway wrote:

Re: code review request: clojure.java.io

2010-06-25 Thread Stuart Halloway
No one spoke up for it. Sorry I'm so late to this particular discussion :-/ Why was to-byte-array left behind? It is a bit of an oddball function, insofar as it doesn't fit into IOFactory or Coercions, but seems to me like a natural cousin to copy. - Chas On May 11, 2010, at 12:16

Re: code review request: clojure.java.io

2010-06-18 Thread Rasmus Svensson
2010/5/11 Stuart Halloway stuart.hallo...@gmail.com Assembla Ticket #311 [1] calls for the promotion of clojure.contrib.iointo clojure (as clojure.java.io). I have attached a patch, and am requesting comments and code review from the community. I think I have found a bug in the

Re: code review request: clojure.java.io

2010-05-14 Thread Michael Wood
On 14 May 2010 04:32, Stuart Halloway stuart.hallo...@gmail.com wrote: On 13 May 2010 03:02, Stuart Halloway stuart.hallo...@gmail.com wrote:  * Decidedly, I have bad feelings when I read about the magic of coercing a String first as a URL, and if not possible, fall back and consider it a

Re: code review request: clojure.java.io

2010-05-14 Thread Laurent PETIT
2010/5/14 Michael Wood esiot...@gmail.com: On 14 May 2010 04:32, Stuart Halloway stuart.hallo...@gmail.com wrote: On 13 May 2010 03:02, Stuart Halloway stuart.hallo...@gmail.com wrote:  * Decidedly, I have bad feelings when I read about the magic of coercing a String first as a URL, and if

Re: code review request: clojure.java.io

2010-05-14 Thread Stuart Halloway
So if program runs from a particular directory and references files as file:///some/file, then if someone can create a directory called file: in that directory with some/file inside that, the program will suddenly try to access the wrong thing? Seems suspicious to me. Two points: (1) This is

Re: code review request: clojure.java.io

2010-05-14 Thread Michael Wood
On 14 May 2010 13:50, Stuart Halloway stuart.hallo...@gmail.com wrote: So if program runs from a particular directory and references files as file:///some/file, then if someone can create a directory called file: in that directory with some/file inside that, the program will suddenly try to

Re: code review request: clojure.java.io

2010-05-13 Thread Michael Wood
Hi On 13 May 2010 03:02, Stuart Halloway stuart.hallo...@gmail.com wrote:  * Decidedly, I have bad feelings when I read about the magic of coercing a String first as a URL, and if not possible, fall back and consider it a local absolute/relative path. I'm mitigated in the sense that either

Re: code review request: clojure.java.io

2010-05-13 Thread Laurent PETIT
2010/5/13 Stuart Halloway stuart.hallo...@gmail.com:  * I also have bad feelings when I see the Coercions protocol defined but not used in conjunction with IOFactory for default behaviours There are very few examples of this, not worth making changing IMO. I'll try to do this as an exercise

Re: code review request: clojure.java.io

2010-05-12 Thread Michael Wood
On 11 May 2010 23:16, Peter Schuller peter.schul...@infidyne.com wrote: Following symlinks in delete-file-recursively sounds like a recipe for disaster to me. Sorry, I should have been more explicit. The (delete-file-recursively ...) in the patch *does* follow symlinks (implicitly, because

Re: code review request: clojure.java.io

2010-05-12 Thread Stuart Halloway
I would like to stop following symlinks, but It doesn't appear that the File API has any ability to detect symlinks. How were you thinking about doing this? Following symlinks in delete-file-recursively sounds like a recipe for disaster to me. Sorry, I should have been more explicit.

Re: code review request: clojure.java.io

2010-05-12 Thread Stefan Bodewig
On 2010-05-12, Stuart Halloway stuart.hallo...@gmail.com wrote: I would like to stop following symlinks, but It doesn't appear that the File API has any ability to detect symlinks. It sounds as if Java7 will finally support dealing with symlinks via NIO.2

Re: code review request: clojure.java.io

2010-05-12 Thread Peter Schuller
I would like to stop following symlinks, but It doesn't appear that the File API has any ability to detect symlinks. How were you thinking about doing this? Argh, you are right of course. I somehow believed that *testing* for whether a path is a symlink was part of File's API, but I failed to

Re: code review request: clojure.java.io

2010-05-11 Thread Stuart Halloway
Using an option for symlinks raises the possibility of using options to let delete-file handle everything, e.g. (delete-file foo :recursive true) instead of (delete-file-recursively foo) Stu Assembla Ticket #311 [1] calls for the promotion of clojure.contrib.io into clojure (as

Re: code review request: clojure.java.io

2010-05-11 Thread Michael Harrison (goodmike)
Stuart, I think it's a great idea to ask the community for input. I'm new to working with Assembla (and still a little new to working with git and github.) So, if I pull down the master branch of Clojure from http://github.com/richhickey/clojure and apply the patch file I find on Assembla, I'll

Re: code review request: clojure.java.io

2010-05-11 Thread Stuart Halloway
Yes, that is right. git apply or git am should work. Stu Stuart, I think it's a great idea to ask the community for input. I'm new to working with Assembla (and still a little new to working with git and github.) So, if I pull down the master branch of Clojure from

Re: code review request: clojure.java.io

2010-05-11 Thread Peter Schuller
Using an option for symlinks raises the possibility of using options to let delete-file handle everything, e.g. (delete-file foo :recursive true) instead of (delete-file-recursively foo) Yes. A potential argument for not conflating them might be that delete-file is a pretty simple

Re: code review request: clojure.java.io

2010-05-11 Thread Michael Wood
On 11 May 2010 18:37, Peter Schuller peter.schul...@infidyne.com wrote: Assembla Ticket #311 [1] calls for the promotion of clojure.contrib.io into clojure (as clojure.java.io). I have attached a patch, and am requesting comments and code review from the community. Should

Re: code review request: clojure.java.io

2010-05-11 Thread Laurent PETIT
Hi Stuart, Nice piece of job ! I will nonetheless try to be constructive and give you some remarks I made to myself while reading the patch: * Shouldn't IOFactory protocol have a docstring to describe the possible options ? (So that it is possible to extend the protocol even further, e.g. when

Re: code review request: clojure.java.io

2010-05-11 Thread Peter Schuller
Following symlinks in delete-file-recursively sounds like a recipe for disaster to me. Sorry, I should have been more explicit. The (delete-file-recursively ...) in the patch *does* follow symlinks (implicitly, because isDirectory() returns true for symlinks pointing to diretories). The