Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
alexandria
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christophe Junke
alexandria
Commits
700ed97b
Commit
700ed97b
authored
16 years ago
by
Attila Lendvai
Browse files
Options
Downloads
Patches
Plain Diff
added read-file-into-byte-vector and write-byte-vector-into-file (until io.lisp's fate is decided)
parent
61cc0148
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
io.lisp
+18
-0
18 additions, 0 deletions
io.lisp
package.lisp
+2
-0
2 additions, 0 deletions
package.lisp
with
20 additions
and
0 deletions
io.lisp
+
18
−
0
View file @
700ed97b
...
@@ -77,6 +77,24 @@ unless it's NIL, which means the system default."
...
@@ -77,6 +77,24 @@ unless it's NIL, which means the system default."
:external-format
external-format
)
:external-format
external-format
)
(
write-sequence
string
file-stream
)))
(
write-sequence
string
file-stream
)))
(
defun
read-file-into-byte-vector
(
pathname
)
"Read PATHNAME into a freshly allocated (unsigned-byte 8) vector."
(
with-input-from-file
(
stream
pathname
:element-type
'
(
unsigned-byte
8
))
(
let
((
length
(
file-length
stream
)))
(
assert
length
)
(
let
((
result
(
make-array
length
:element-type
'
(
unsigned-byte
8
))))
(
read-sequence
result
stream
)
result
))))
(
defun
write-byte-vector-into-file
(
bytes
pathname
&key
(
if-exists
:error
)
if-does-not-exist
)
"Write BYTES to PATHNAME."
(
check-type
bytes
(
vector
(
unsigned-byte
8
)))
(
with-output-to-file
(
stream
pathname
:if-exists
if-exists
:if-does-not-exist
if-does-not-exist
:element-type
'
(
unsigned-byte
8
))
(
write-sequence
bytes
stream
)))
(
defun
copy-file
(
from
to
&key
(
if-to-exists
:supersede
)
(
defun
copy-file
(
from
to
&key
(
if-to-exists
:supersede
)
(
element-type
'
(
unsigned-byte
8
))
finish-output
)
(
element-type
'
(
unsigned-byte
8
))
finish-output
)
(
with-input-from-file
(
input
from
:element-type
element-type
)
(
with-input-from-file
(
input
from
:element-type
element-type
)
...
...
This diff is collapsed.
Click to expand it.
package.lisp
+
2
−
0
View file @
700ed97b
...
@@ -222,6 +222,8 @@
...
@@ -222,6 +222,8 @@
#:with-output-to-file
#:with-output-to-file
#:read-file-into-string
#:read-file-into-string
#:write-string-into-file
#:write-string-into-file
#:read-file-into-byte-vector
#:write-byte-vector-into-file
#:copy-stream
#:copy-stream
#:copy-file
#:copy-file
;; new additions collected at the end
;; new additions collected at the end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment