Re: [ANN] fs - file system utilities for Clojure

2011-03-22 Thread siyu798
Miki, We do have functions to normalize and convert path and I just think the dirname function should not do the conversion. In fact there's no benefits to do so as /a/b/c on *nix is not equal to \a\b\c in window, same goes for c:\a\b\c in window for c:/a/b/c in *nix. In 99.99% percent of

Re: [ANN] fs - file system utilities for Clojure

2011-03-21 Thread Miki
I *think* it's fixed, can you test with the latest sources in bitbucket? -- 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

Re: [ANN] fs - file system utilities for Clojure

2011-03-21 Thread siyu798
Miki, Thanks for the quick response, but I'm not just looking for a fix for the testcase, I'm looking for the dirname function to return the same output regardless of the machine that the code is running on, eg (dirname /a/b/c) should return /a/b/ on both win and unix just like the

Re: [ANN] fs - file system utilities for Clojure

2011-03-21 Thread Miki
Greetings, (dirname /a/b/c) should return /a/b/ on both win and unix You can use fs/*separator for that: user= (binding [fs/*separator* :] (fs/join a b c)) a:b:c However users expect the path to be right depending on the OS, meaning \ on windows and / on *nix. HTH, -- Miki -- You

Re: [ANN] fs - file system utilities for Clojure

2011-03-18 Thread siyu798
Hi Miki, The dirname testcase fails on Window. Does it make sense that even if it's running on window it should still pass? In another word, don't you think that it should not convert the separator implicitly? (deftest dirname-test (is (= (dirname /a/b/c) /a/b))) user= (fs/dirname

Re: [ANN] fs - file system utilities for Clojure

2011-03-18 Thread Miki
Greetings, The dirname testcase fails on Window. Does it make sense that even if it's running on window it should still pass? In another word, don't you think that it should not convert the separator implicitly? I agree with you, and I'll try to fix the test. However I don't have access

Re: [ANN] fs - file system utilities for Clojure

2011-03-16 Thread Steve Miner
I've been using this to get the extension: (defn extension [file] (when file (let [base (fs/basename file) dot (.lastIndexOf ^String base .)] (when (pos? dot) (subs base (inc dot)) Steve Miner On Mar 15, 2011, at 5:56 PM, siyu798 wrote: Hi Miki, We are

Re: [ANN] fs - file system utilities for Clojure

2011-03-16 Thread Miki
We are planning to use this file system utilities, and we need a function to get file extension. Currently we're using apache common for that, but we want to get rid of apache common altogether. Can you add this functionality to the fs.clj? Thx Added in 0.7.1 (thanks to Steve Miner

Re: [ANN] fs - file system utilities for Clojure

2011-03-15 Thread siyu798
Hi Miki, We are planning to use this file system utilities, and we need a function to get file extension. Currently we're using apache common for that, but we want to get rid of apache common altogether. Can you add this functionality to the fs.clj? Thx Si Yu -- You received this message

Re: [ANN] fs - file system utilities for Clojure

2011-01-27 Thread Miki
-I'd rather (copy-tree src dest) worked like cp -R src dest (including when dest doesn't exist) rather than cp -R src/* dest/. Done in 0.6.0. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: [ANN] fs - file system utilities for Clojure

2011-01-24 Thread Michael Gardner
On Jan 19, 2011, at 11:32 AM, Miki wrote: I'd appreciate some comments about need functionality, bugs, code reviews and such. Thanks for this useful library. Some suggestions: -I'd rather (copy-tree src dest) worked like cp -R src dest (including when dest doesn't exist) rather than cp -R

Re: [ANN] fs - file system utilities for Clojure

2011-01-24 Thread Miki
-I'd rather (copy-tree src dest) worked like cp -R src dest (including when dest doesn't exist) rather than cp -R src/* dest/. I agree, working on that. -It would be nice if functions that create files or dirs (like mkdir and touch) returned the new object's path, to allow chaining.

Re: [ANN] fs - file system utilities for Clojure

2011-01-19 Thread Rayne
It isn't nearly as big a deal as you think it is. I'm guessing you have a single file called 'fs.clj' with the namespace 'fs', right? mkdir src/fs/ mv src/fs.clj src/fs/core.clj and then edit the file and change the namespace to fs.core. Why is that such a big deal? I understand that you're

Re: [ANN] fs - file system utilities for Clojure

2011-01-19 Thread Miki
It isn't nearly as big a deal as you think it is. I'm guessing you have a single file called 'fs.clj' with the namespace 'fs', right? mkdir src/fs/ mv src/fs.clj src/fs/core.clj and then edit the file and change the namespace to fs.core. I know it's easy to do, I just don't think I

Re: [ANN] fs - file system utilities for Clojure

2011-01-19 Thread Eric Schulte
Miki miki.teb...@gmail.com writes: It isn't nearly as big a deal as you think it is. I'm guessing you have a single file called 'fs.clj' with the namespace 'fs', right? mkdir src/fs/ mv src/fs.clj src/fs/core.clj and then edit the file and change the namespace to fs.core. I know it's

Re: [ANN] fs - file system utilities for Clojure

2011-01-19 Thread B Smith-Mannschott
On Wed, Jan 19, 2011 at 15:30, Rayne disciplera...@gmail.com wrote: It isn't nearly as big a deal as you think it is. I'm guessing you have a single file called 'fs.clj' with the namespace 'fs', right? mkdir src/fs/ mv src/fs.clj src/fs/core.clj and then edit the file and change the

Re: [ANN] fs - file system utilities for Clojure

2011-01-19 Thread Meikel Brandmeyer
Hi, Am 19.01.2011 um 21:24 schrieb B Smith-Mannschott: This is a retarded 'convention', and it isn't really much of a convention at that. Just because Clojure itself has a 'core.clj', doesn't mean everyone else needs one now too. I blame Leiningen's defaults. For counter-examples, take a

Re: [ANN] fs - file system utilities for Clojure

2011-01-19 Thread Miki
I have one question, is there any documentation available for the functions provided by fs? I would love a place where I could go to scan the available functions, other than the source code. https://bitbucket.org/tebeka/fs/src -- You received this message because you are subscribed to

Re: [ANN] fs - file system utilities for Clojure

2011-01-19 Thread Adam
There appears to be a bug in walk when there is an empty folder somewhere beneath the specified directory. I've only tested this on Win XP but this triggers a NullPointerException on fs 0.4.0: (walk c:/empty (fn [ a] true)) No message. [Thrown class java.lang.NullPointerException]

Re: [ANN] fs - file system utilities for Clojure

2011-01-14 Thread Miki
First, I suggest that you look at the standard clojure.java.io package for some useful functions that are already in Clojure 1.2. Done in 0.3.0 (as well as some other added functions), thanks again. -- You received this message because you are subscribed to the Google Groups Clojure

Re: [ANN] fs - file system utilities for Clojure

2011-01-13 Thread Tim Visher
I'm missing something blindingly obvious. Where can I download this? On Wed, Jan 12, 2011 at 3:48 PM, Miki miki.teb...@gmail.com wrote: [fs 0.2.0-SNAPSHOT] is out, featuring: abspath     Return absolute path basename     Return the last part of path copy     Copy a file cwd     Return

Re: [ANN] fs - file system utilities for Clojure

2011-01-13 Thread gaz jones
probably clojars.org (or by putting [fs 0.2.0-SNAPSHOT] in your project.clj if you're using lein... On Thu, Jan 13, 2011 at 7:11 AM, Tim Visher tim.vis...@gmail.com wrote: I'm missing something blindingly obvious. Where can I download this? On Wed, Jan 12, 2011 at 3:48 PM, Miki

Re: [ANN] fs - file system utilities for Clojure

2011-01-13 Thread Miki
I'm missing something blindingly obvious. Where can I download this? probably clojars.org (or by putting [fs 0.2.0-SNAPSHOT] in your project.clj if you're using lein... Yup, it's in clojars. However if you prefer to download the jar manually, you can get it from

Re: [ANN] fs - file system utilities for Clojure

2011-01-13 Thread Laurent PETIT
2011/1/13 Miki miki.teb...@gmail.com I'm missing something blindingly obvious. Where can I download this? probably clojars.org (or by putting [fs 0.2.0-SNAPSHOT] in your project.clj if you're using lein... Yup, it's in clojars. However if you prefer to download the jar manually, you can

Re: [ANN] fs - file system utilities for Clojure

2011-01-13 Thread Steve Miner
Thanks for shaing. I was just about to write several functions along these lines. I have a couple of comments. First, I suggest that you look at the standard clojure.java.io package for some useful functions that are already in Clojure 1.2. In particular, you could use io/file instead of

Re: [ANN] fs - file system utilities for Clojure

2011-01-13 Thread gaz jones
there is also this: https://github.com/jashmenn/clj-file-utils which seems to be very similar On Thu, Jan 13, 2011 at 9:04 AM, Steve Miner stevemi...@gmail.com wrote: Thanks for shaing.  I was just about to write several functions along these lines.  I have a couple of comments. First, I

Re: [ANN] fs - file system utilities for Clojure

2011-01-13 Thread Miki
First, I suggest that you look at the standard clojure.java.io package for some useful functions that are already in Clojure 1.2. In particular, you could use io/file instead of (File. xxx) in your code to add some flexibility to the kinds of things that can be treated as a file. I

[ANN] fs - file system utilities for Clojure

2011-01-12 Thread Miki
[fs 0.2.0-SNAPSHOT] is out, featuring: abspath Return absolute path basename Return the last part of path copy Copy a file cwd Return the current working directory delete Delete path directory? True if path is a directory dirname Return directory name executable?

Re: [ANN] fs - file system utilities for Clojure

2011-01-12 Thread László Török
Good stuff, just what I was looking for, can't wait to try... sent from my mobile device On Jan 12, 2011 9:48 PM, Miki miki.teb...@gmail.com wrote: [fs 0.2.0-SNAPSHOT] is out, featuring: abspath Return absolute path basename Return the last part of path copy Copy a file cwd Return the