.. _label10:
-10. システム関数
+システム関数
==================================
.. _label10.1:
-10.1 ファイル名
+ファイル名
----------------------------------
.. index::
single: dir()
.. _label10.1.1:
-10.1.1 file, dir
+file, dir
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: tmpfile()
.. _label10.1.2:
-10.1.2 tmpfile
+tmpfile
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: in()
.. _label10.1.3:
-10.1.3 in
+in
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: basename()
.. _label10.1.4:
-10.1.4 basename
+basename
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: dirname()
.. _label10.1.5:
-10.1.5 dirname
+dirname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: rootname()
.. _label10.1.6:
-10.1.6 rootname
+rootname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: dirof()
.. _label10.1.7:
-10.1.7 dirof
+dirof
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: fullname()
.. _label10.1.8:
-10.1.8 fullname
+fullname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: absname()
.. _label10.1.9:
-10.1.9 absname
+absname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: homename()
.. _label10.1.10:
-10.1.10 homename
+homename
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: suffix()
.. _label10.1.11:
-10.1.11 suffix
+suffix
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label10.2:
-10.2 パスによる検索
+パスによる検索
----------------------------------
.. index::
single: where()
.. _label10.2.2:
-10.2.2 where
+where
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The where function is similar to which, except it returns the list of all the locations of the given executable (in the order in which the corresponding directories appear in $PATH). In case a command is handled internally by the Shell object, the first string in the output will describe the command as a built-in function.
single: rehash()
.. _label10.2.3:
-10.2.3 rehash
+rehash
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: exists-in-path()
.. _label10.2.4:
-10.2.4 exists-in-path
+exists-in-path
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: digest-optional()
.. _label10.2.5:
-10.2.5 digest, digest-optional
+digest, digest-optional
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: find-in-path-optional()
.. _label10.2.6:
-10.2.6 find-in-path, find-in-path-optional
+find-in-path, find-in-path-optional
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: digest-in-path-optional()
.. _label10.2.7:
-10.2.7 digest-in-path, digest-in-path-optional
+digest-in-path, digest-in-path-optional
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label10.3:
-10.3 ファイル検査
+ファイル検査
----------------------------------
.. index::
single: target-is-proper()
.. _label10.3.1:
-10.3.1 file-exists, target-exists, target-is-proper
+file-exists, target-exists, target-is-proper
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: stat-reset()
.. _label10.3.2:
-10.3.2 stat-reset
+stat-reset
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: filter-proper-targets()
.. _label10.3.3:
-10.3.3 filter-exists, filter-targets, filter-proper-targets
+filter-exists, filter-targets, filter-proper-targets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: find-targets-in-path-optional()
.. _label10.3.4:
-10.3.4 find-targets-in-path, find-targets-in-path-optional
+find-targets-in-path, find-targets-in-path-optional
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: find-ocaml-targets-in-path-optional()
.. _label10.3.5:
-10.3.5 find-ocaml-targets-in-path-optional
+find-ocaml-targets-in-path-optional
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The find-ocaml-targets-in-path-optional function is very similar to the find-targets-in-path-optional one, except an OCaml-style search is used, where for every element of the search path and for every name being searched for, first the uncapitalized version is tried and if it is not buildable, then the capitalized version is tried next.
single: file-sort()
.. _label10.3.6:
-10.3.6 file-sort
+file-sort
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: .ORDER
.. _label10.3.6.1:
-10.3.6.1 ソートルール
+ソートルール
"""""""""""""""""""""""""""""""""""
.. It is possible to further constrain the sorter through the use of sort rules. A sort rule is declared in two steps. The target must be listed as an .ORDER target; and then a set of sort rules must be given. A sort rule defines a pattern constraint.
single: file-check-sort()
.. _label10.3.7:
-10.3.7 file-check-sort
+file-check-sort
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label10.4:
-10.4 ファイルの検索とリスト
+ファイルの検索とリスト
----------------------------------
.. OMake commands are “glob-expanded” before being executed. That is, names may contain patterns that are expanded to sequences of file and directory names. The syntax follows the standard bash(1), csh(1), syntax, with the following rules.
single: glob()
.. _label10.4.1:
-10.4.1 glob
+glob
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: ls()
.. _label10.4.2:
-10.4.2 ls
+ls
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: subdirs()
.. _label10.4.3:
-10.4.3 subdirs
+subdirs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label10.5:
-10.5 ファイル操作
+ファイル操作
----------------------------------
.. index::
single: mkdir()
.. _label10.5.1:
-10.5.1 mkdir
+mkdir
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: Stat
.. _label10.5.2:
-10.5.2 Stat
+Stat
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The Stat object represents an information about a filesystem node, as returned by the stat and lstat functions. It contains the following fields.
single: lstat()
.. _label10.5.3:
-10.5.3 stat, lstat
+stat, lstat
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: unlink()
.. _label10.5.4:
-10.5.4 unlink
+unlink
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: cp()
.. _label10.5.5:
-10.5.5 rename
+rename
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: link()
.. _label10.5.6:
-10.5.6 link
+link
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: symlink()
.. _label10.5.7:
-10.5.7 symlink
+symlink
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: readlink()
.. _label10.5.8:
-10.5.8 readlink
+readlink
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: chmod()
.. _label10.5.9:
-10.5.9 chmod
+chmod
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: chown()
.. _label10.5.10:
-10.5.10 chown
+chown
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: truncate()
.. _label10.5.11:
-10.5.11 truncate
+truncate
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: umask()
.. _label10.5.12:
-10.5.12 umask
+umask
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label10.6:
-10.6 vmount
+vmount
----------------------------------
.. index::
single: vmount()
.. _label10.6.1:
-10.6.1 vmount
+vmount
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: add-project-directories()
.. _label10.6.2:
-10.6.2 add-project-directories
+add-project-directories
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: remove-project-directories()
.. _label10.6.3:
-10.6.3 remove-project-directories
+remove-project-directories
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label10.7:
-10.7 ファイルの内容を元にした検索
+ファイルの内容を元にした検索
----------------------------------
.. index::
single: test()
.. _label10.7.1:
-10.7.1 test
+test
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: find()
.. _label10.7.2:
-10.7.2 find
+find
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label10.8:
-10.8 I/O 関数
+I/O 関数
----------------------------------
.. index::
single: stderr
.. _label10.8.1:
-10.8.1 標準出力先
+標準出力先
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The following variables define the standard channels.
single: open-in-string()
.. _label10.8.2:
-10.8.2 open-in-string
+open-in-string
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The open-in-string treats a string as if it were a file and returns a channel for reading.
single: out-contents()
.. _label10.8.3:
-10.8.3 open-out-string, out-contents
+open-out-string, out-contents
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The open-out-string creates a channel that writes to a string instead of a file. The string may be retrieved with the out-contents function.
single: fopen()
.. _label10.8.4:
-10.8.4 fopen
+fopen
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The fopen function opens a file for reading or writing.
single: close()
.. _label10.8.5:
-10.8.5 close
+close
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: input-line()
.. _label10.8.6:
-10.8.6 read, input-line
+read, input-line
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: write()
.. _label10.8.7:
-10.8.7 write
+write
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: lseek()
.. _label10.8.8:
-10.8.8 lseek
+lseek
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: rewind()
.. _label10.8.9:
-10.8.9 rewind
+rewind
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: tell()
.. _label10.8.10:
-10.8.10 tell
+tell
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: flush()
.. _label10.8.11:
-10.8.11 flush
+flush
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: channel-name()
.. _label10.8.12:
-10.8.12 channel-name
+channel-name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: dup()
.. _label10.8.13:
-10.8.13 dup
+dup
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: dup2()
.. _label10.8.14:
-10.8.14 dup2
+dup2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: set-nonblock()
.. _label10.8.15:
-10.8.15 set-nonblock
+set-nonblock
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: set-close-on-exec-mode()
.. _label10.8.16:
-10.8.16 set-close-on-exec-mode
+set-close-on-exec-mode
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The set-close-on-exec-mode function sets the close-on-exec flags for the given channels. If the close-on-exec flag is set, the channel is not inherited by child processes. Otherwise it is.
single: pipe()
.. _label10.8.17:
-10.8.17 pipe
+pipe
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: mkfifo()
.. _label10.8.18:
-10.8.18 mkfifo
+mkfifo
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: select()
.. _label10.8.19:
-10.8.19 select
+select
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: lockf()
.. _label10.8.20:
-10.8.20 lockf
+lockf
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: InetAddr
.. _label10.8.21:
-10.8.21 InetAddr
+InetAddr
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The InetAddr object describes an Internet address. It contains the following fields.
single: Host
.. _label10.8.22:
-10.8.22 Host
+Host
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. A Host object contains the following fields.
single: gethostbyname()
.. _label10.8.23:
-10.8.23 gethostbyname
+gethostbyname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: Protocol
.. _label10.8.24:
-10.8.24 Protocol
+Protocol
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The Protocol object represents a protocol entry. It has the following fields.
single: getprotobyname()
.. _label10.8.25:
-10.8.25 getprotobyname
+getprotobyname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: Service
.. _label10.8.26:
-10.8.26 Service
+Service
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The Service object represents a network service. It has the following fields.
single: getservbyname()
.. _label10.8.27:
-10.8.27 getservbyname
+getservbyname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: socket()
.. _label10.8.28:
-10.8.28 socket
+socket
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: bind()
.. _label10.8.29:
-10.8.29 bind
+bind
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: listen()
.. _label10.8.30:
-10.8.30 listen
+listen
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: accept()
.. _label10.8.31:
-10.8.31 accept
+accept
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: connect()
.. _label10.8.32:
-10.8.32 connect
+connect
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: getchar()
.. _label10.8.33:
-10.8.33 getchar
+getchar
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: gets()
.. _label10.8.34:
-10.8.34 gets
+gets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: fgets()
.. _label10.8.35:
-10.8.35 fgets
+fgets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: eprintln()
.. _label10.9:
-10.9 出力関数
+出力関数
----------------------------------
.. Output is printed with the print and println functions. The println function adds a terminating newline to the value being printed, the print function does not.
single: eprintvln()
.. _label10.10:
-10.10 値を出力する関数
+値を出力する関数
----------------------------------
.. Values can be printed with the printv and printvln functions. The printvln function adds a terminating newline to the value being printed, the printv function does not.
.. _label10.10.1:
-10.10.1 その他の関数
+その他の関数
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. index::
single: set-channel-line()
.. _label10.10.1.1:
-10.10.1.1 set-channel-line
+set-channel-line
""""""""""""""""""""""""""""""""""
::
.. _label10.11:
-10.11 高レベルな I/O 関数
+高レベルな I/O 関数
----------------------------------
.. index::
single: awk()
.. _label10.11.1:
-10.11.1 正規表現
+正規表現
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. Many of the higher-level functions use regular expressions. Regular expressions are defined by strings with syntax nearly identical to awk(1).
single: cat()
.. _label10.11.2:
-10.11.2 cat
+cat
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: grep()
.. _label10.11.3:
-10.11.3 grep
+grep
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: scan()
.. _label10.11.4:
-10.11.4 scan
+scan
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: awk()
.. _label10.11.5:
-10.11.5 awk
+awk
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: fsubst()
.. _label10.11.6:
-10.11.6 fsubst
+fsubst
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: lex()
.. _label10.11.7:
-10.11.7 lex
+lex
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: lex-search()
.. _label10.11.8:
-10.11.8 lex-search
+lex-search
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: Lexer
.. _label10.11.9:
-10.11.9 Lexer
+Lexer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The Lexer object defines a facility for lexical analysis, similar to the lex(1) and flex(1) programs.
single: RuntimeException
.. _label10.11.10:
-10.11.10 レキサのマッチング
+レキサのマッチング
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. During lexical analysis, clauses are selected by longest match. That is, the clause that matches the longest sequence of input characters is chosen for evaluation. If no clause matches, the lexer raises a RuntimeException. If more than one clause matches the same amount of input, the first one is chosen for evaluation.
.. _label10.11.11:
-10.11.11 拡張したレキサの定義
+拡張したレキサの定義
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. Suppose we wish to augment the lexer example so that it ignores comments. We will define comments as any text that begins with the string (*, ends with *), and comments may be nested.
.. _label10.11.12:
-10.11.12 lexerオブジェクトを扱いやすくする
+lexerオブジェクトを扱いやすくする
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. Clause bodies may also end with an export directive. In this case the lexer object itself is used as the returned token. If used with the Parser object below, the lexer should define the loc, name and value fields in each export clause. Each time the Parser calls the lexer, it calls it with the lexer returned from the previous lex invocation.
single: Parser
.. _label10.11.13:
-10.11.13 Parser
+Parser
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The ``Parser`` object provides a facility for syntactic analysis based on context-free grammars.
.. _label10.11.14:
-10.11.14 パーサの呼び出し
+パーサの呼び出し
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The parser is called with the ``$(parser1.parse-channel start, channel)`` or ``$(parser1.parse-file start, file)`` functions. The start argument is the start symbol, and the channel or file is the input to the parser.
.. _label10.11.15:
-10.11.15 パースの制御
+パースの制御
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The parser generator generates a pushdown automation based on LALR(1) tables. As usual, if the grammar is ambiguous, this may generate shift/reduce or reduce/reduce conflicts. These conflicts are printed to standard output when the automaton is generated.
.. _label10.11.16:
-10.11.16 拡張したパーサ
+拡張したパーサ
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. Parsers may also be extended by inheritance. For example, let's extend the grammar so that it also recognizes the ``<<`` and ``>>`` shift operations.
single: Passwd
.. _label10.11.17:
-10.11.17 Passwd
+Passwd
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The Passwd object represents an entry in the system's user database. It contains the following fields.
single: getpwuid()
.. _label10.11.18:
-10.11.18 getpwnam, getpwuid
+getpwnam, getpwuid
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: getpwents()
.. _label10.11.19:
-10.11.19 getpwents
+getpwents
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: Group
.. _label10.11.20:
-10.11.20 Group
+Group
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The Group object represents an entry in the system's user group database. It contains the following fields.
single: getgrgid()
.. _label10.11.21:
-10.11.21 getgrnam, getgrgid
+getgrnam, getgrgid
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: tgetstr()
.. _label10.11.22:
-10.11.22 tgetstr
+tgetstr
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: xterm-escape-end()
.. _label10.11.23:
-10.11.23 xterm-escape-begin, xterm-escape-end
+xterm-escape-begin, xterm-escape-end
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: xterm-escape()
.. _label10.11.24:
-10.11.24 xterm-escape
+xterm-escape
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: prompt-invisible-end()
.. _label10.11.25:
-10.11.25 prompt-invisible-begin, prompt-invisible-end
+prompt-invisible-begin, prompt-invisible-end
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: prompt-invisible()
.. _label10.11.26:
-10.11.26 prompt-invisible
+prompt-invisible
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: gettimeofday()
.. _label10.11.27:
-10.11.27 gettimeofday
+gettimeofday
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::