Backup
This commit is contained in:
parent
bea47ea639
commit
8baff1392d
|
|
@ -5,4 +5,5 @@ venv
|
|||
foreign
|
||||
run-test*
|
||||
.*
|
||||
|
||||
test-program
|
||||
*.link
|
||||
|
|
|
|||
98
Makefile
98
Makefile
|
|
@ -1,80 +1,44 @@
|
|||
.POSIX:
|
||||
.DEFAULT: all
|
||||
SCHEME=chibi
|
||||
RNRS=r7rs
|
||||
SRFI=170
|
||||
AUTHOR=Retropikzel
|
||||
DOCKER_TAG=latest
|
||||
|
||||
SRFI_FILE=srfi/${SRFI}.sld
|
||||
VERSION=$(shell cat srfi/${SRFI}/VERSION)
|
||||
DESCRIPTION=$(shell head -n1 srfi/${SRFI}/README.md)
|
||||
README=srfi/${SRFI}/README.html
|
||||
TESTFILE=srfi/${SRFI}/test.scm
|
||||
TMPDIR=.tmp/${SCHEME}
|
||||
|
||||
PKG=srfi-${SRFI}-${VERSION}.tgz
|
||||
|
||||
SFX=scm
|
||||
AKKU_PACKAGES=
|
||||
ifeq "${RNRS}" "r6rs"
|
||||
SFX=sps
|
||||
AKKU_PACKAGES="akku-r7rs"
|
||||
endif
|
||||
|
||||
ifeq "${SCHEME}" "capyscheme"
|
||||
DOCKER_TAG=head
|
||||
endif
|
||||
ifeq "${SCHEME}" "chibi"
|
||||
DOCKER_TAG=head
|
||||
endif
|
||||
ifeq "${SCHEME}" "chicken"
|
||||
DOCKER_TAG=head
|
||||
endif
|
||||
ifeq "${SCHEME}" "gauche"
|
||||
DOCKER_TAG=head
|
||||
endif
|
||||
|
||||
VERSION=$$(cat srfi/${SRFI}/VERSION)
|
||||
|
||||
all: package
|
||||
|
||||
package: srfi/${SRFI}/LICENSE srfi/${SRFI}/VERSION
|
||||
echo "<pre>$$(cat README.md)</pre>" > README.html
|
||||
cp srfi/${SRFI}/index.html index.html
|
||||
cp srfi/${SRFI}/test.scm test.scm
|
||||
snow-chibi package \
|
||||
--version=${VERSION} \
|
||||
--authors=${AUTHOR} \
|
||||
--doc=${README} \
|
||||
--description="${DESCRIPTION}" \
|
||||
${SRFI_FILE}
|
||||
--license="$$(cat srfi/${SRFI}/LICENSE)" \
|
||||
--version="${VERSION}" \
|
||||
--authors="$$(cat srfi/${SRFI}/AUTHORS 2>/dev/null || echo 'Retropikzel')" \
|
||||
--doc=index.html \
|
||||
--description="$$(cat srfi/${SRFI}/DESCRIPTION)" \
|
||||
srfi/${SRFI}.sld
|
||||
|
||||
install:
|
||||
snow-chibi install --impls=${SCHEME} ${PKG}
|
||||
snow-chibi install --impls=${SCHEME} --skip-tests?=1 ${PKG}
|
||||
|
||||
${PKG}: package
|
||||
|
||||
testfiles: ${PKG}
|
||||
rm -rf .tmp
|
||||
mkdir -p .tmp
|
||||
cp ${PKG} .tmp
|
||||
cp -r srfi .tmp/
|
||||
cat test-headers.${SFX} ${TESTFILE} \
|
||||
| sed 's/SRFI/${SRFI}/' > .tmp/test.${SFX}
|
||||
cat ${TESTFILE} >> run-test.${SFX}
|
||||
if [ "${RNRS}" = "r6rs" ]; \
|
||||
then if [ -d ../foreign-c ]; \
|
||||
then cp -r ../foreign-c/foreign .tmp/; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
test: testfiles
|
||||
cd .tmp && COMPILE_R7RS=${SCHEME} compile-r7rs -o test-program test.${SFX}
|
||||
cd .tmp && ./test-program
|
||||
test:
|
||||
cp srfi/${SRFI}/test.scm test.scm
|
||||
COMPILE_R7RS=${SCHEME} compile-r7rs -o test-program test.scm
|
||||
./test-program
|
||||
|
||||
test-docker: testfiles
|
||||
cd .tmp && \
|
||||
DOCKER_TAG=${DOCKER_TAG} \
|
||||
SNOW_PACKAGES="srfi.64 ${PKG}" \
|
||||
AKKU_PACKAGES=${AKKU_PACKAGES} \
|
||||
APT_PACKAGES="libcurl4-openssl-dev" \
|
||||
COMPILE_R7RS=${SCHEME} \
|
||||
TEST_R7RS_DEBUG=1 \
|
||||
CSC_OPIONS="-L -lcurl" \
|
||||
test-r7rs -o test-program test.${SFX}
|
||||
DOCKER_TAG=${DOCKER_TAG} \
|
||||
SNOW_PACKAGES="srfi.64 ${PKG}" \
|
||||
AKKU_PACKAGES=${AKKU_PACKAGES} \
|
||||
APT_PACKAGES="libcurl4-openssl-dev" \
|
||||
COMPILE_R7RS=${SCHEME} \
|
||||
TEST_R7RS_DEBUG=1 \
|
||||
CSC_OPIONS="-L -lcurl" \
|
||||
test-r7rs -o test-program test.scm
|
||||
|
||||
update-info:
|
||||
curl -L -o srfi/${SRFI}/index.html https://srfi.schemers.org/srfi-${SRFI}/srfi-${SRFI}.html
|
||||
printf "(foreign c) $$(cat srfi/${SRFI}/index.html | grep '<title>' | sed 's/<title>//' | sed 's/<\/title>//' | sed 's/^[ \t]*//' | tr -d '\n')" > srfi/${SRFI}/DESCRIPTION
|
||||
|
||||
clean:
|
||||
git clean -X -f
|
||||
|
|
|
|||
26
README.md
26
README.md
|
|
@ -1,7 +1,27 @@
|
|||
To install SRFI library run
|
||||
# (foreign c) SRFis
|
||||
|
||||
SRFIs made using [(foreign c)](https://codeberg.org/foreign-c/foreign-c) library.
|
||||
|
||||
|
||||
## SRFI-106: Basic socket interface
|
||||
|
||||
Prioritazing TCP client sockets.
|
||||
|
||||
## SRFI-170: POSIX API
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
To install published SRFI run:
|
||||
|
||||
snow-fort install --impls=chibi srfi.N
|
||||
|
||||
|
||||
To install SRFI from this repository run:
|
||||
|
||||
make SCHEME=chibi SRFI=106 build install
|
||||
|
||||
|
||||
Change chibi to any other implementation supported by snow-chibi, and 106
|
||||
to any filename without suffix in srfi/*.sld
|
||||
## Usage
|
||||
|
||||
Import and use.
|
||||
|
|
|
|||
17
srfi/106.scm
17
srfi/106.scm
|
|
@ -83,10 +83,7 @@
|
|||
(ai-flags (if (>= (length args) 3)
|
||||
(list-ref args 2)
|
||||
(socket-merge-flags *ai-v4mapped* *ai-addrconfig*)))
|
||||
(ai-protocol
|
||||
(if (>= (length args) 4)
|
||||
(list-ref args 3)
|
||||
*ipproto-ip*)))
|
||||
(ai-protocol (if (>= (length args) 4) (list-ref args 3) *ipproto-ip*)))
|
||||
(let* ((ai-family-offset (c-type-size 'int))
|
||||
(ai-socktype-offset (* (c-type-size 'int) 2))
|
||||
(ai-protocol-offset (* (c-type-size 'int) 3))
|
||||
|
|
@ -149,9 +146,21 @@
|
|||
names))))
|
||||
|
||||
(define (socket-send socket bv . flags)
|
||||
(display "HERE :")
|
||||
(write socket)
|
||||
(newline)
|
||||
(write bv)
|
||||
(newline)
|
||||
(display "HERE :")
|
||||
(write socket)
|
||||
(newline)
|
||||
(write bv)
|
||||
(newline)
|
||||
(let* ((msg (bytevector->c-bytevector bv))
|
||||
(msg-len (bytevector-length bv))
|
||||
(sent-count (c-send (socket-file-descriptor socket) msg msg-len 0)))
|
||||
(display sent-count)
|
||||
(newline)
|
||||
(when (= sent-count -1)
|
||||
(c-perror (string->c-bytevector "socket-send error"))
|
||||
(raise-continuable "socket-send error"))
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
(foreign c) SRFI 106: Basic socket interface
|
||||
166
srfi/106/LICENSE
166
srfi/106/LICENSE
|
|
@ -1,165 +1 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
MIT
|
||||
|
|
|
|||
|
|
@ -1,5 +1,33 @@
|
|||
(test-begin "srfi-106")
|
||||
(import (scheme base)
|
||||
(scheme write)
|
||||
(scheme read)
|
||||
(scheme char)
|
||||
(scheme file)
|
||||
(scheme process-context)
|
||||
(retropikzel tap)
|
||||
(foreign c)
|
||||
(srfi 64)
|
||||
(srfi 106))
|
||||
|
||||
(test-runner-current (tap-runner))
|
||||
|
||||
(test-begin "106")
|
||||
|
||||
|
||||
(test-begin "TCP Client")
|
||||
|
||||
(test-begin "URL")
|
||||
(let ((sock (make-client-socket "tcpbin.com" "4242"))
|
||||
(msg "Hello world!"))
|
||||
(socket-send sock (string->utf8 msg))
|
||||
(test-equal msg (utf8->string (socket-recv sock (string-length msg))))
|
||||
(socket-close))
|
||||
(test-begin "URL")
|
||||
|
||||
(test-end "TCP Client")
|
||||
|
||||
|
||||
#|
|
||||
(define sock1-port "3005")
|
||||
(define sock2-port "3006")
|
||||
|
||||
|
|
@ -41,4 +69,6 @@
|
|||
(write (utf8->string (socket-recv client-sock1 3)))
|
||||
(newline)
|
||||
|
||||
(test-end "srfi-106")
|
||||
|#
|
||||
|
||||
(test-end "106")
|
||||
|
|
|
|||
10
srfi/170.scm
10
srfi/170.scm
|
|
@ -186,9 +186,7 @@
|
|||
(error "file-info implementation does not support ports as arguments"))
|
||||
(let* ((fname* (string->c-bytevector fname/port))
|
||||
(stat* (make-c-bytevector (c-type-size stat-struct)))
|
||||
(result (if follow?
|
||||
(c-stat fname* stat*)
|
||||
(c-lstat fname* stat*))))
|
||||
(result (if follow? (c-stat fname* stat*) (c-lstat fname* stat*))))
|
||||
(when (< result 0)
|
||||
(let* ((error-message "file-info error")
|
||||
(error-msg* (string->c-bytevector error-message)))
|
||||
|
|
@ -291,8 +289,10 @@
|
|||
(define (read-symlink fname) (internal-read-symlink fname 128))
|
||||
|
||||
(define (rename-file old-fname new-fname)
|
||||
(c-rename (string->c-bytevector old-fname)
|
||||
(string->c-bytevector new-fname)))
|
||||
(let* ((old-fname* (string->c-bytevector old-fname))
|
||||
(new-fname* (string->c-bytevector new-fname)))
|
||||
(c-rename old-fname* new-fname*)
|
||||
(c-bytevector-free old-fname* new-fname*)))
|
||||
|
||||
(define (delete-directory fname)
|
||||
(let* ((fname* (string->c-bytevector fname))
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
(foreign c) SRFI 170: POSIX API
|
||||
|
|
@ -1,3 +1,14 @@
|
|||
(import (scheme base)
|
||||
(scheme write)
|
||||
(scheme read)
|
||||
(scheme char)
|
||||
(scheme file)
|
||||
(scheme process-context)
|
||||
(retropikzel tap)
|
||||
(foreign c)
|
||||
(srfi 64)
|
||||
(srfi 170))
|
||||
|
||||
(test-begin "srfi-170")
|
||||
|
||||
(write (posix-time))
|
||||
|
|
|
|||
|
|
@ -0,0 +1,180 @@
|
|||
(import (scheme base)
|
||||
(scheme write)
|
||||
(scheme read)
|
||||
(scheme char)
|
||||
(scheme file)
|
||||
(scheme process-context)
|
||||
(retropikzel tap)
|
||||
(foreign c)
|
||||
(srfi 64)
|
||||
(srfi 170))
|
||||
|
||||
(test-begin "srfi-170")
|
||||
|
||||
(write (posix-time))
|
||||
(newline)
|
||||
|
||||
(write (monotonic-time))
|
||||
(newline)
|
||||
|
||||
(define niceness (nice 1))
|
||||
(test-assert (number? niceness))
|
||||
(test-assert (> niceness 0))
|
||||
|
||||
(define fi (file-info "/tmp" #f))
|
||||
(write fi)
|
||||
(newline)
|
||||
(write (file-info:mode fi))
|
||||
(newline)
|
||||
|
||||
|
||||
#|
|
||||
(define tmp-dir "/tmp/foreign-c-srfi-170")
|
||||
(for-each
|
||||
(lambda (file)
|
||||
(delete-file (string-append tmp-dir "/" file)))
|
||||
(directory-files tmp-dir #t))
|
||||
(when (file-exists? tmp-dir)
|
||||
(delete-directory tmp-dir))
|
||||
(create-directory tmp-dir)
|
||||
|
||||
(define tmp-file (string-append tmp-dir "/test.txt"))
|
||||
(when (file-exists? tmp-file) (delete-file tmp-file))
|
||||
|
||||
(with-output-to-file
|
||||
tmp-file
|
||||
(lambda ()
|
||||
(display "Hello")
|
||||
(newline)))
|
||||
|
||||
(define tmp-dotfile (string-append tmp-dir "/.dot.txt"))
|
||||
(when (file-exists? tmp-dotfile) (delete-file tmp-dotfile))
|
||||
|
||||
(with-output-to-file
|
||||
tmp-dotfile
|
||||
(lambda ()
|
||||
(display "Dot")
|
||||
(newline)))
|
||||
|
||||
(define tmp-dir-info (file-info tmp-dir #f))
|
||||
(define tmp-file-info (file-info tmp-file #f))
|
||||
(define tmp-dotfile-info (file-info tmp-dotfile #f))
|
||||
|
||||
(set-file-mode tmp-file 0755)
|
||||
|
||||
|
||||
(define dir1 (open-directory tmp-dir))
|
||||
(write (read-directory dir1))
|
||||
(newline)
|
||||
(write (read-directory dir1))
|
||||
(newline)
|
||||
(write (read-directory dir1))
|
||||
(newline)
|
||||
(close-directory dir1)
|
||||
|
||||
(define dir2 (open-directory tmp-dir #t))
|
||||
(write (read-directory dir2))
|
||||
(newline)
|
||||
(write (read-directory dir2))
|
||||
(newline)
|
||||
(write (read-directory dir2))
|
||||
(newline)
|
||||
(close-directory dir2)
|
||||
|
||||
(display "temp-file-prefix: ")
|
||||
(display (temp-file-prefix))
|
||||
(newline)
|
||||
|
||||
(display "create-temp-file: ")
|
||||
(define tf1 (create-temp-file))
|
||||
(display tf1)
|
||||
(newline)
|
||||
|
||||
(display "create-temp-file, with prefix lol: ")
|
||||
(define tf2 (create-temp-file "/tmp/lol"))
|
||||
(display tf2)
|
||||
(newline)
|
||||
|
||||
(call-with-temporary-filename
|
||||
(lambda (path)
|
||||
(display "call-with-temporary-filename, path: ")
|
||||
(display path)
|
||||
(newline)))
|
||||
|
||||
(display "Current directory: ")
|
||||
(display (current-directory))
|
||||
(newline)
|
||||
|
||||
(set-current-directory! "/tmp")
|
||||
(display "Current directory: ")
|
||||
(display (current-directory))
|
||||
(newline)
|
||||
|
||||
(display "pid: ")
|
||||
(display (pid))
|
||||
(newline)
|
||||
|
||||
(display "uid: ")
|
||||
(display (user-uid))
|
||||
(newline)
|
||||
|
||||
(display "gid: ")
|
||||
(display (user-gid))
|
||||
(newline)
|
||||
|
||||
(display "euid: ")
|
||||
(display (user-effective-uid))
|
||||
(newline)
|
||||
|
||||
(display "egid: ")
|
||||
(display (user-effective-gid))
|
||||
(newline)
|
||||
|
||||
(display "user-supplementary-gids: ")
|
||||
(display (user-supplementary-gids))
|
||||
(newline)
|
||||
|
||||
(display "user-info, uid 0: ")
|
||||
(display (user-info 0))
|
||||
(newline)
|
||||
|
||||
(display "user-info, name root: ")
|
||||
(display (user-info "root"))
|
||||
(newline)
|
||||
|
||||
(display "group-info: ")
|
||||
(display (group-info "root"))
|
||||
(newline)
|
||||
|
||||
(display "set-environment-variable! lol=lel ")
|
||||
(newline)
|
||||
(set-environment-variable! "lol" "lel")
|
||||
|
||||
;(display "get-environment-variable lol: ")
|
||||
;(display (get-environment-variable "lol"))
|
||||
;(newline)
|
||||
|
||||
(define movefile "/tmp/test1.txt")
|
||||
(with-output-to-file
|
||||
movefile
|
||||
(lambda ()
|
||||
(display "Hello")
|
||||
(newline)))
|
||||
|
||||
(rename-file movefile "/tmp/test2.txt")
|
||||
|
||||
(display "File /tmp/test2.txt exists? ")
|
||||
(display (file-exists? "/tmp/test2.txt"))
|
||||
(newline)
|
||||
|
||||
(display "file-info-directory? on dir: ")
|
||||
(write (file-info-directory? tmp-dir-info))
|
||||
(newline)
|
||||
|
||||
(display "file-info-directory? on file: ")
|
||||
(write (file-info-directory? tmp-file-info))
|
||||
(newline)
|
||||
|#
|
||||
|
||||
|
||||
(test-end "srfi-170")
|
||||
Loading…
Reference in New Issue