Raynes / fs

File system utilities for Clojure.
453 stars 119 forks source link

Getting it running on windows #14

Closed joeatwork closed 12 years ago

joeatwork commented 12 years ago

Hi! I realize this is kind of a big checkin, but I figured I'd ask- Most of the changes here are devoted to getting the test suite running in windows, which means dealing with two different flavors of file separator ("\" and good old "/") and an unpredictable drive specifier prefix in paths.

I also added some new stuff, please take it or leave it. When I forked I intended to add

ls - similar to list-dir, but returns absolute paths

But I got sucked into the test stuff. I've also added

split path limit - pathwise split with limit (like string/split)

Which supports the parsing of tilde/home-dir paths, but seemed useful and reasonable externally.

Thank you so much for maintaining this module! Joe

Raynes commented 12 years ago

Could you give me a rundown of what the problems were? The whole point of the Java File class is to provide an abstract representation of a file that, behind the scenes, does the right thing on whatever system it is running on. Was there some problem? How is expand-user even useful at all on Windows anyway?

As for the addition of ls, I'm purposely avoiding returning paths when I can return file objects for the purpose of not having to convert back and forth for no reason. Your ls is trivial enough that I don't feel guilty for telling people to inline it themselves in their own code. I'd rather not put it in fs.

So, yeah, there are definitely some questions to be asked here. Furthermore, there is no way I can pull this code in its current state regardless. Some of it doesn't make a lot of sense and it goes against every implicit and explicit style guideline imaginable. Now, please don't take offense to this, especially if you're new to Clojure. It is absolutely understandable. I am not really concerned about the state of the pull request as much as I am the issues. I definitely want to address any problems. Can you please explain the problems in detail?

joeatwork commented 12 years ago

No problem, thanks for taking a look! (And for maintaining the module!) Certainly, ls is super simple, and no problem to build elsewhere.

The issues are really easy for you to discover yourself - just run "lein test" on windows- all of my changes other than ls are fixes to test failures (and as you can see, none of them were very complex.) I figured it wouldn't be polite to submit a patch with a bunch of busted tests. I'm actually have another commit in the system (I'm "invalid-email-address" from the bit bucket repo) which was also mostly about getting windows tests to pass.

Again, thanks for your attention!

joeatwork commented 12 years ago

I've closed this issue (since it's bound together with the patch) but please find some notes about quirks with Windows below.

Also, windows does have a notion of Home directory, and even supports tilde expansion in some circumstances. Anyhow, that's a bit more detail.

Thanks again for maintaining this module!