ANN: FileManip 0.1, an expressive file manipulation library

The FileManip package provides expressive functions and combinators for searching, matching, and manipulating files. It provides three modules. System.FilePath.Find lets you search a filesystem hierarchy efficiently: find always (extension ==? ".rb") >>= mapM_ remove System.FilePath.GlobPattern lets you perform glob-style pattern matching, without going through a regexp engine: "foo.c" ~~ "*.c" ==> True System.FilePath.Manip lets you rename files procedurally, edit files in place, or save old copies as backups: modifyWithBackup (<.> "bak") (unlines . map (takeWhile (/= ',')) . lines) "myPoorFile.csv"

Bryan O'Sullivan wrote:
The FileManip package provides expressive functions and combinators for searching, matching, and manipulating files.
As seems to be my habit, I forgot something important, namely where to get FileManip from. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/FileManip-0.1 Online docs: http://darcs.serpentine.com/filemanip/dist/doc/html/FileManip/ Darcs repo: darcs get http://darcs.serpentine.com/filemanip

The FileManip package provides expressive functions and combinators for searching, matching, and manipulating files.
hi Brian, i'm a fan of find | xargs, so a portable haskell replacement unencumbered by viral licenses would be very welcome. i have no intention to participate in yet-another-licencing-discussion, i would just like to ask whether those limitations of your offering are an accident or intended? claus

On Wed, 2007-05-02 at 09:59 +0100, Claus Reinke wrote:
The FileManip package provides expressive functions and combinators for searching, matching, and manipulating files.
hi Brian,
i'm a fan of find | xargs, so a portable haskell replacement unencumbered by viral licenses would be very welcome. i have no intention to participate in yet-another-licencing-discussion, i would just like to ask whether those limitations of your offering are an accident or intended?
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/FileManip-0.1 Apparently it's under the *L*GPL not the GPL, so it's not the "viral" license that you were thinking of perhaps? Duncan

i'm a fan of find | xargs, so a portable haskell replacement unencumbered by viral licenses would be very welcome. i have no intention to participate in yet-another-licencing-discussion, i would just like to ask whether those limitations of your offering are an accident or intended?
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/FileManip-0.1
Apparently it's under the *L*GPL not the GPL, so it's not the "viral" license that you were thinking of perhaps?
no, i browsed the license file before asking my question (no non-restrictive license needs to be longer than a page). if i wanted to use that library for anything i want to distribute, my only chance to avoid the source re-distribution and advertising clauses would be dynamic linking - the same reasons why some of us a looking forward to the gmp replacement. i'd rather roll my own find than look at the sources under the current license, which may or may not have been the author's intention when choosing that particular license. hence my question. similarly for the unix dependency - it could be inherent in the design, or an accident of the author's current platform. <soapbox> <title>platform-independent haskelling</title> if i may take this opportunity for a message to other haskell authors: haskell makes it possible to write portable code. there are some cases where platform dependencies are unavoidable, and where one might write code for one platform, hoping that others add the branches for their platforms. there are even fewer cases where the functionality provided does not apply to other platforms. but for the majority of code, the trick is simply not to use platform-specific tricks. a small price to pay for not being exclusive. </soapbox> ;-) claus

On Wed, 2007-05-02 at 12:00 +0100, Claus Reinke wrote:
i'm a fan of find | xargs, so a portable haskell replacement unencumbered by viral licenses would be very welcome. i have no intention to participate in yet-another-licencing-discussion, i would just like to ask whether those limitations of your offering are an accident or intended?
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/FileManip-0.1
Apparently it's under the *L*GPL not the GPL, so it's not the "viral" license that you were thinking of perhaps?
no, i browsed the license file before asking my question (no non-restrictive license needs to be longer than a page). if i wanted to use that library for anything i want to distribute, my only chance to avoid the source re-distribution and advertising clauses would be dynamic linking
Ah ok. Well remember that we will be getting dynamic linking in future and the solution at the moment with static linking is to distribute static libraries to allow the user to relink. This allows closed source apps and complies with the LGPL. Of course if you simply don't like licenses longer than a page there's not much anyone can do to help :-) Duncan

Hi
no, i browsed the license file before asking my question (no non-restrictive license needs to be longer than a page). if i wanted to use that library for anything i want to distribute, my only chance to avoid the source re-distribution and advertising clauses would be dynamic linking
Ah ok. Well remember that we will be getting dynamic linking in future and the solution at the moment with static linking is to distribute static libraries to allow the user to relink. This allows closed source apps and complies with the LGPL.
Remember than Yhc and Hugs both don't link the code together, so you can have more freedom with licenses. Of course, distributing your closed source app under Hugs isn't that sensible... Thanks Neil

On May 2, 2007, at 7:00 , Claus Reinke wrote:
my question. similarly for the unix dependency - it could be inherent in the design, or an accident of the author's current platform.
The Haskell libraries don't currently provide a platform-independent way to do most file tests. I discovered this while working on the file test operators in Pugs: aside from some very basic tests, everything interesting requires the POSIX hierarchy (hence the unix package). -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

Claus Reinke wrote:
if i wanted to use that library for anything i want to distribute, my only chance to avoid the source re-distribution and advertising clauses would be dynamic linking
I believe that the magical protective properties of dynamic linking amount to no more than folklore. So you might not want to bet your proprietary farm on that distinction without first seeking legal advice.
the unix dependency - it could be inherent in the design, or an accident of the author's current platform.
Unfortunately, the standard libraries do not provide portable ways to check file status. Much of what's currently in the unix library would in fact compile and work fine on Windows, and could usefully be moved from unix to a more portable posix library. Regarding your soapbox, the FileManip library uses Neil Mitchell's new filepath library for precisely the purpose of portable file name handling.

Claus Reinke wrote:
i have no intention to participate in yet-another-licencing-discussion, i would just like to ask whether those limitations of your offering are an accident or intended?
I didn't use the LGPL by accident. However, I might be amenable to persuasion, perhaps more so if you climb down from that thing that looks awfully like a high horse from here.

i have no intention to participate in yet-another-licencing-discussion, i would just like to ask whether those limitations of your offering are an accident or intended?
I didn't use the LGPL by accident. However, I might be amenable to persuasion, perhaps more so if you climb down from that thing that looks awfully like a high horse from here.
no horses here, apart from hobby-horses;-) some people write closed software, some people write freed software, some people write free software. authors choose their licenses, potential users use or stay away. the somewhat pained tone of that email was because this was a library i might have liked to use, hindered by two all too typical issues. licensing is a question i don't want to be drawn into again. it was predictable that some would be tempted to restart that thread (it has been a recurring topic not just in haskell land, but many haskellers have shown themselves flexible enough to converge, on bsd-style short-and-sweet, with about two exceptions -readline and gmp- remaining out of haskellers' control in the main libraries, and more under similar external constraints in gui contexts:-), but as for myself, i only wanted an answer to base my decision on, such as the one you've just given. portability is another matter, because here it has proven a lot easier to avoid non-portable features from the word go than to write for one's most familiar platform first, then worry about porting. where that is not yet possible or easy, those limitations need to be raised, so that they can be worked on, filepath being a recent example. don't put me on a high horse just because i'd prefer another license and am terribly tired of the discussion that tends to raise (i've been there on all sides for hugs/ghc/../programatica/hare/.. !-). claus

Claus Reinke wrote:
the somewhat pained tone of that email was because this was a library i might have liked to use, hindered by two all too typical issues.
To resurrect an old thread, version 0.3.1 is now BSD3-licensed, for your hacking pleasure, and updated to work with GHC 6.8.1.
portability is another matter, [...]
Unfortunately, the portable System.Directory API is fairly crippled. I gather there's a unix-compat package for Windows now, which might get you closer to a usable API. If you find that you can get the two working happily, please send a patch or two. (Unfortunately, I don't have time to hack Haskell on Windows myself.) Thanks,
participants (5)
-
Brandon S. Allbery KF8NH
-
Bryan O'Sullivan
-
Claus Reinke
-
Duncan Coutts
-
Neil Mitchell