1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
\documentclass{article}
\usepackage{open-axiom}
\begin{document}
\title{src/algebra fname.spad}
\author{Stephen M. Watt}
\maketitle
\begin{abstract}
\end{abstract}
\tableofcontents
\eject
\section{category FNCAT FileNameCategory}
<<category FNCAT FileNameCategory>>=
)abbrev category FNCAT FileNameCategory
++ Author: Stephen M. Watt
++ Date Created: 1985
++ Date Last Updated: June 20, 1991
++ Basic Operations:
++ Related Domains:
++ Also See:
++ AMS Classifications:
++ Keywords:
++ Examples:
++ References:
++ Description:
++ This category provides an interface to names in the file system.
FileNameCategory(): Category == Join(SetCategory, HomotopicTo String) with
filename: (String, String, String) -> %
++ filename(d,n,e) creates a file name with
++ d as its directory, n as its name and e as its extension.
++ This is a portable way to create file names.
++ When d or t is the empty string, a default is used.
directory: % -> String
++ directory(f) returns the directory part of the file name.
name: % -> String
++ name(f) returns the name part of the file name.
extension: % -> String
++ extension(f) returns the type part of the file name.
exists?: % -> Boolean
++ exists?(f) tests if the file exists in the file system.
readable?: % -> Boolean
++ readable?(f) tests if the named file exist and can it be opened
++ for reading.
writable?: % -> Boolean
++ writable?(f) tests if the named file be opened for writing.
++ The named file need not already exist.
new: (String, String, String) -> %
++ new(d,pref,e) constructs the name of a new writable file with
++ d as its directory, pref as a prefix of its name and
++ e as its extension.
++ When d or t is the empty string, a default is used.
++ An error occurs if a new file cannot be written in the given
++ directory.
@
\section{domain FNAME FileName}
<<domain FNAME FileName>>=
)abbrev domain FNAME FileName
++ Author: Stephen M. Watt
++ Date Created: 1985
++ Date Last Updated: September 14, 2008
++ Basic Operations:
++ Related Domains:
++ Also See:
++ AMS Classifications:
++ Keywords:
++ Examples:
++ References:
++ Description:
++ This domain provides an interface to names in the file system.
FileName(): FileNameCategory == add
import %equal: (%,%) -> Boolean from Foreign Builtin
f1 = f2 == %equal(f1,f2)
coerce(f: %): OutputForm == f::String::OutputForm
coerce(f: %): String == NAMESTRING(f)$Lisp
coerce(s: String): % == PARSE_-NAMESTRING(s)$Lisp
filename(d,n,e) == fnameMake(d,n,e)$Lisp
directory(f:%): String == fnameDirectory(f)$Lisp
name(f:%): String == fnameName(f)$Lisp
extension(f:%): String == fnameType(f)$Lisp
exists? f == existingFile?(f::String)$Lisp
readable? f == readablep(f::String)$Lisp = 1@SingleInteger
writable? f == writeablep(f::String)$Lisp > 0@SingleInteger
new(d,pref,e) == fnameNew(d,pref,e)$Lisp
@
\section{License}
<<license>>=
--Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
--All rights reserved.
--
--Redistribution and use in source and binary forms, with or without
--modification, are permitted provided that the following conditions are
--met:
--
-- - Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
--
-- - Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in
-- the documentation and/or other materials provided with the
-- distribution.
--
-- - Neither the name of The Numerical ALgorithms Group Ltd. nor the
-- names of its contributors may be used to endorse or promote products
-- derived from this software without specific prior written permission.
--
--THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
--IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
--TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
--PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
--OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
--EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
--PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
--PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
--LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
--NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
--SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@
<<*>>=
<<license>>
<<category FNCAT FileNameCategory>>
<<domain FNAME FileName>>
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}
|