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
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
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
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
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
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
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
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
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
-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
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
-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.
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
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
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
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
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
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
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]
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
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
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
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
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
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
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
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
[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?
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
29 matches
Mail list logo