[ cl-cookbook-Patches-1522710 ] File Slurping
"SourceForge.net" <[email protected]> Fri, 14 Jul 2006 11:12:31 -0700
| Newsgroups | gmane.lisp.cookbook |
|---|---|
| Message-ID | <[email protected]> |
Patches item #1522710, was opened at 2006-07-14 11:12
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=447474&aid=1522710&group_id=46815
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Widget (example)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: File Slurping
Initial Comment:
I looked through the file section of the cookbook and
found no simple way to get the string contents from a
text file.
with the-file being a pathname, this snippet returns
the string contents of a file:
(with-open-file (f the-file)
(let ((seq (make-string (file-length f))))
(read-sequence seq f)
(coerce seq 'string))
)
I added the coerce at the bottom, but got the main part
from http://www.emmett.ca/~sabetts/slurp.html
According to this article, this is also the fastest.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=447474&aid=1522710&group_id=46815
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642