ファイルシステム


wrong-disk-pathname

type: Function
arguments: wrong-disk-pathname X
package: lisp
注)どこにもみつからない?

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

wrong-disk

type: Misc
package: lisp
注)どこにもみつからない?

SeeAlso: wrong-disk-pathname
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

write-region

type: Function
arguments: write-region FROM TO FILENAME &optional APPEND CHAR-ENCODING EOL-CODE
package: editor
file: builtin.l
リージョンをファイルに書き込みます。
APPEND が non nil なら追加書き込みをします。

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

write-file

type: Function
arguments: write-file FILENAME &optional NOMSG APPEND CHAR-ENCODING EOL-CODE
package: editor
file: files.l
バッファの内容を FILENAME に書き込みます。[C-x C-w]
バッファ名およびバッファに関連付けられたファイルは変更しません。

  NOMSG         : non-nil ならステータスバーに経過メッセージを表示しません。
  APPEND        : non-nil ならファイルに追加します。
  CHAR-ENCODING : エンコーディングを指定します。
  EOL-CODE      : 改行コードを指定します。

SeeAlso: append-file
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

valid-path-p

type: Function
arguments: valid-path-p PATHNAME
package: lisp
file: builtin.l
パスが有効かどうかをチェックします。

  PATHNAME : 有効かどうかをチェックするパス

ここで「有効なパス」というのは、最終的なファイルやディレクトリが存在する
ことを指すのではなく、途中の経路が存在することを指します。ファイルを指し
示している場合には、そのファイル自体の有無は関係ありません。そのファイル
に至るディレクトリが全て存在していることが有効か否かに関わります。

使用例:
  (valid-path-p "foo/bar/zzz.txt")
  =>nil
  (valid-path-p "/autoexec.bat")
  =>t

SeeAlso: check-valid-pathname
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

user-homedir-pathname

type: Function
arguments: user-homedir-pathname
package: lisp
file: builtin.l
ユーザーのホームディレクトリを返します。

find-fileしたときに"~/"で参照可能なディレクトリです。
起動時に、このディレクトリに格納されている.xyzzyを読み込みます。
同一PCを複数人で使用していたり、ネットワーク共有されたフォルダに
xyzzyを格納した場合には、ユーザ毎にホームディレクトリの設定して
.xyzzyを切り替えることができます。

ユーザのホームディレクトリは、以下の順番で決定されます。

  1)iniファイル内の[init]homeDir
  2)環境変数 XYZZYHOME
  3)環境変数 HOME
  4)環境変数 HOMEDRIVE + HOMEPATH
  5)iniファイル内の[init]logDir
  6)xyzzy.exeのpath

使用例:
  (user-homedir-pathname)
  => "C:/HOME/"

SeeAlso: si:system-root
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

user-config-path

type: Function
arguments: user-config-path
package: editor
file: builtin.l
ユーザ設定を格納しているディレクトリを返します。
ダイアログでの規定値等が格納されるディレクトリです。

起動時オプション -config で指定したり,XYZZYCONFIGPATH
で指定可能です。両方指定された場合,起動時オプションが
優先されます。

使用例:
  (user-config-path)
  =>"H:/xyzzy/usr/Administrator/w2k/"

SeeAlso: user-homedir-pathname
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

truename

type: Function
arguments: truename PATHNAME
package: lisp
file: builtin.l
相対パスを絶対パスに変えます。

  PATHNAME : 変換するパスを指定します。

使用例:
  ;;; 相対パス及び絶対パスを指定して変換する。
  (truename ".")
  => "C:/applications/xyzzy"
  (truename "C:/applications/xyzzy/")
  => "C:/applications/xyzzy"

SeeAlso: get-short-path-name
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

tail-f

type: Function
arguments: tail-f FILENAME
package: editor
file: tail-f.l
tail コマンドの -f オプションのように、更新され続けるようなファイルを終
端まで読み込み続けようとします。

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

sub-directory-p

type: Function
arguments: sub-directory-p DIRECTORY PARENT
package: lisp
file: builtin.l
DIRECTORYがPARENTのサブディレクトリならt、そうでなければnilを返します。

使用例: 
  (sub-directory-p "c:/windows/system" "c:/windows")
  => t

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

special-file-p

type: Function
arguments: special-file-p PATHNAME
package: lisp
file: builtin.l
PATHNAMEがデバイスファイル(CON, AUX, NUL, PRN, LPT1/2/3/4, COM1/2/3/4)か
否かを返します。
  t    デバイスファイルである。
  nil  デバイスファイルでない。

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

set-per-device-directory

type: Function
arguments: set-per-device-directory DIRECTORY
package: lisp
file: builtin.l
ドライブ毎のデフォルトのディレクトリを設定します。ドライブ毎のデ
フォルトのディレクトリは、ファイラ等で移動すると毎回更新されます。
更新されたくない場合には、*auto-update-per-device-directory*をnil
に設定します。

使用例:
  (set-per-device-directory "D:/foo/bar")
  (set-per-device-directory "E:/bar/foo")

SeeAlso: *auto-update-per-device-directory*
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

set-file-write-time

type: Function
arguments: set-file-write-time FILENAME UNIVERSAL-TIME
package: lisp
file: builtin.l
ファイルの最終更新日を変更します。

  FILENAME       : ファイル名を指定します。フルパスでなければ
                   (default-directory)からの相対パスになります。
  UNIVERSAL-TIME : 最終更新日をユニバーサルタイム形式で指定します。

SeeAlso: file-write-time
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

set-default-directory

type: Function
arguments: set-default-directory DIRECTORY &optional BUFFER
package: editor
file: builtin.l
バッファが作業しているディレクトリを変更します。

  DIRECTORY : ディレクトリを指定します。
  BUFFER    : バッファを指定します。
              指定がなければカレントバッファになります。

SeeAlso: default-directory
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

save-some-buffers

type: Function
arguments: save-some-buffers &optional VERBOSE (FN #'WRITE-FILE)
package: editor
file: files.l
開いているバッファを保存します。[C-x s]
  VERBOSE : non-nilの場合保存するファイルごとにダイアログを表示して確認します。

SeeAlso: save-all-buffers
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

save-buffers-kill-xyzzy

type: Function
arguments: save-buffers-kill-xyzzy &optional VERBOSE
package: editor
file: files.l
開いているバッファを保存して xyzzy を終了します。
save-some-buffers と kill-xyzzy の組み合わせです。

  VERBOSE : non-nil の場合保存するファイルごとにダイアログを表示して確認します。

SeeAlso: save-all-buffers-kill-xyzzy
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

save-buffer

type: Function
arguments: save-buffer &optional CHAR-ENCODING EOL-CODE
package: editor
file: builtin.l
バッファの内容を、バッファに関連付けられたファイルに書き込みます。[C-x C-s]

バッファに変更が無かった場合は何もしません。
バッファに変更があり、関連付けられたファイルがない場合、エラーになります。

  CHAR-ENCODING : エンコーディングを指定します。
  EOL-CODE      : 改行コードを指定します。

SeeAlso: emacs-write-file
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

save-all-buffers-kill-xyzzy

type: Function
arguments: save-all-buffers-kill-xyzzy
package: editor
file: files.l
すべてのバッファを保存して xyzzy を終了します。
save-all-buffers と kill-xyzzy の組み合わせです。

SeeAlso: save-buffers-kill-xyzzy
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

save-all-buffers

type: Function
arguments: save-all-buffers
package: editor
file: files.l
すべてのバッファを保存します。
ファイル名があるバッファに対しては確認せずに保存します。
ファイル名がないバッファに対しては、ダイアログで保存するファイルを指定させます。

SeeAlso: save-all-buffers-kill-xyzzy
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

resolve-shortcut

type: Function
arguments: resolve-shortcut PATHNAME
package: editor
file: builtin.l
ショートカットからファイル名を求めます。

  PATHNAME : ショートカットを指定します。

使用例:
  (resolve-shortcut "d:/winnt/profiles/henmi2/personal/my documentsへのショートカット.lnk")
  => "G:/My Documents"

SeeAlso: create-shortcut
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

rename-file

type: Function
arguments: rename-file FILE NEW-NAME &key :if-exists :if-access-denied
package: lisp
file: builtin.l
ファイル名を変更します。
  
  FILE              : 変更前のファイル名を指定します。
  NEW-NAME          : 変更後のファイル名を指定します。
  :if-exists        : ファイルが存在する場合の動作を指定します。
        :error          エラーを出力します。
        :skip           エラーは出力せず、nilを返します。
        :overwrite      強制的にファイル名の変更を試みます。
  :if-access-denied : アクセスが拒否された場合の動作を指定します。
        :error          エラーを出力します。
        :skip           エラーは出力せず、nilを返します。

変更できたかどうかで戻り値が変わります。

  t   変更に成功
  nil 変更に失敗

使用例:
  (rename-file "C:/xyzzy/test.txt" "C:/xyzzy/test2.txt")
  => t

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

remove-trail-slash

type: Function
arguments: remove-trail-slash STRING
package: editor
file: builtin.l
STRINGの末尾に"/"があれば削除した文字列を返します。
使用例:
  (remove-trail-slash "ffjfj")
  =>"ffjfj"

  (remove-trail-slash "ffjfj/")
  =>"ffjfj"

SeeAlso: append-trail-slash
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

read-file

type: Function
arguments: read-file FILENAME &optional ENCODING NOMSG
package: editor
file: builtin.l
バッファをクリアして FILENAME の内容を書き込みます。[C-x C-r]
バッファ名およびバッファに関連付けられたファイルは変更しません。

  ENCODING : エンコーディングを指定します。
  NOMSG    : non-nil ならステータスバーに経過メッセージを表示しません。

SeeAlso: find-file
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

pathname-type

type: Function
arguments: pathname-type PATHNAME
package: lisp
file: builtin.l
ファイル名の拡張子を取り出します。拡張子がなければnilを返します。

  PATHNAME : 拡張子を取り出すファイル名を指定します。

使用例:
  ;;; foo.lzh
  (pathname-type "foo.lzh")
  =>"lzh"
  (pathname-type "foo/bar/zzz.txt")
  =>"txt"

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

pathname-name

type: Function
arguments: pathname-name PATHNAME
package: lisp
file: builtin.l
PATHNAMEのファイル名(拡張子無し)を返します。
使用例:
  (setq a (merge-pathnames "xyzzy.exe" (si:system-root)))
  =>"C:/Applications/xyzzy/xyzzy.exe"

  (pathname-name a)
  =>"xyzzy"

SeeAlso: pathname-type
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

pathname-match-p

type: Function
arguments: pathname-match-p PATHNAME WILDNAME
package: lisp
file: builtin.l
PATHNAME が WILDNAME で指定されたワイルドカードにマッチするかどうかを
返します。

  PATHNAME : 検査対象のパス文字列
  WILDNAME : ワイルドカード文字列
             先頭文字が | の場合は否定の意味となる。
             *brackets-is-wildcard-character* の値が non-nil の場合は
             文字列中の [...] をワイルドカードと見なす。

戻り値:
  t    PATHNAME が WILDNAME にマッチする。
  nil  PATHNAME が WILDNAME にマッチしない。

使用例:
  (setq p (merge-pathnames "xyzzy.exe" (si:system-root)))
  =>"C:/Applications/xyzzy/xyzzy.exe"

  (setq w (merge-pathnames "xyzzy.*" (si:system-root)))
  =>"C:/Applications/xyzzy/xyzzy.*"

  (wild-pathname-p p)
  =>nil

  (wild-pathname-p w)
  =>t

  (pathname-match-p p w)
  =>t

  (pathname-match-p p (concat "|" w))
  =>nil

  (setq w "*/xyzzy.ini")
  =>"*/xyzzy.ini"

  (pathname-match-p p w)
  =>nil

  (pathname-match-p p (concat "|" w))
  =>t

SeeAlso: wild-pathname-p
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

pathname-host

type: Function
arguments: pathname-host PATHNAME
package: lisp
file: builtin.l
PATHNAMEのホスト名を返します。
使用例:
  (setq a "//SAMURAI/Applications/xyzzy/xyzzy.exe")
  =>"//SAMURAI/Applications/xyzzy/xyzzy.exe"

  (pathname-host a)
  =>"SAMURAI"

  (setq a (merge-pathnames "xyzzy.exe" (si:system-root)))
  =>"C:/Applications/xyzzy/xyzzy.exe"

  (pathname-host a)
  =>nil

SeeAlso: pathname-type
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

pathname-directory

type: Function
arguments: pathname-directory PATHNAME
package: lisp
file: builtin.l
PATHNAMEのディレクトリ名を返します。各階層ごとの名前を要素とするリスト形
式で返されます。
使用例:
  (setq a (merge-pathnames "xyzzy.exe" (si:system-root)))
  =>"C:/Applications/xyzzy/xyzzy.exe"

  (pathname-directory a)
  =>("Applications" "xyzzy")

SeeAlso: pathname-type
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

pathname-device

type: Function
arguments: pathname-device PATHNAME
package: lisp
file: builtin.l
PATHNAMEのドライブ名を返します。
使用例:
  (setq a "//SAMURAI/Applications/xyzzy/xyzzy.exe")
  => "//SAMURAI/Applications/xyzzy/xyzzy.exe"

  (pathname-device a)
  => nil

  (setq a (merge-pathnames "xyzzy.exe" (si:system-root)))
  => "C:/Applications/xyzzy/xyzzy.exe"

  (pathname-device a)
  "C"

SeeAlso: pathname-type
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

path-equal

type: Function
arguments: path-equal PATHNAME1 PATHNAME2
package: lisp
file: builtin.l
PATHNAME1とPATHNAME2が同じパスを指していればt、そうでなければnilを返します。

使用例:
  (path-equal "C:/Windows/" "c:/windows")
  => t

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

new-file

type: Function
arguments: new-file
package: editor
file: files.l
ファイルに関連付けられていない新しいバッファ *untitled* を作ります。

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

merge-pathnames

type: Function
arguments: merge-pathnames PATHNAME &optional DEFAULTS
package: lisp
file: builtin.l
パスとファイル名をくっつけます。

  PATHNAME : ファイル名の部分を指定します。
  DEFUALTS : パスの部分を指定します。
             指定しないと(default-directory)のパスが使用されます。

使用例:
  ;;; "c:/foo"と"bar.l"をくっつける。
  (merge-pathnames "bar.l" "c:/foo")
  => "c:/foo/bar.l"

  (merge-pathnames "bar.l" "c:/foo/") <--ディレクトリの末尾に/がつい
  => "c:/foo/bar.l"                      ているかとか気にしなくていい。

SeeAlso: file-namestring
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

make-temp-file-name

type: Function
arguments: make-temp-file-name &optional PREFIX SUFFIX DIRECTORY DIRECTORY-P
package: editor
file: builtin.l
一時作業用のファイルを作成しそのパスを返します。
ファイルは即時に作成されます。同じようにディレクトリを作成することも可能です。

  PREFIX      : 一時作業用のファイルの接頭子
  SUFFIX      : 一時作業用のファイルの拡張子
                指定が無ければ".tmp"となります。
  DIRECTORY   : 一時作業用のファイルを作成するディレクトリ
                指定が無ければ環境変数TMPに作成されます。
  DIRECTORY-P : ファイルではなくディレクトリを作成する場合
        t       ディレクトリを作成します。
        nil     ファイルを作成します。

使用例:
  ;;; C:\spoolに一時作業用ファイルを作成します。 
  (make-temp-file-name "_den" "tmp" "c:/spool")
  => "c:/spool/_denc0dc.tmp"

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

list-archive

type: Function
arguments: list-archive ARCHIVE-FILE &optional FILE-NAME-ONLY
package: editor
file: builtin.l
アーカイブのファイル名一覧を取り出します。

  ARCHIVE-FILE   : 一覧を取得するアーカイブを指定します。
  FILE-NAME-ONLY : 戻り値の形式を指定します。
        t   ファイル名(ディレクトリ名)のみを返します。
        nil ファイル名(ディレクトリ名)、属性、サイズ、タイムスタンプを
            返します。

使用例:
  (list-archive "foo.lzh")

SeeAlso: create-archive
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

insert-file

type: Function
arguments: insert-file FILENAME &optional ENCODING
package: editor
file: files.l
指定されたファイルをカーソルの位置に読み込みます。[C-x i]

SeeAlso: insert-file-contents
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

get-short-path-name

type: Function
arguments: get-short-path-name PATHNAME
package: lisp
file: builtin.l
PATHNAMEの8.3形式でのパスを返します。
使用例:
  (setq a (merge-pathnames "xyzzy.exe" (si:system-root)))
  =>"C:/Applications/xyzzy/xyzzy.exe"

  (get-short-path-name a)
  =>"C:/APPLIC~2/xyzzy/xyzzy.exe"

SeeAlso: truename
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

get-file-info

type: Function
arguments: get-file-info PATHNAME
package: editor
file: builtin.l
ファイルの属性をまとめて取得します。属性・最終更新日・サイズ・短い
名前のリストの形式です。属性は以下の感じで。
  ed::*file-attribute-readonly*
  ed::*file-attribute-hidden*
  ed::*file-attribute-system*
  ed::*file-attribute-directory*
  ed::*file-attribute-archive*
  ed::*file-attribute-compressed*

使用例:
  (setq i (get-file-info (si:system-root)))
  => (16 3208385786 0 "XYZZY")
  (logand (car i) ed::*file-attribute-directory*)
  => 16
  (logand (car i) ed::*file-attribute-hidden*)
  => 0
  (format-date-string "%y/%m/%d %H:%M:%S" (cadr i))
  => "01/09/02 11:16:26"

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

get-file-attributes

type: Function
arguments: get-file-attributes PATHNAME
package: editor
file: builtin.l
ファイルの属性を返します。ファイルサイズや最終更新日などの情報も一括して取
得したい場合には、get-file-infoを使用しましょう。

  PATHNAME : 属性を取得するファイル名を指定します。

戻り値は以下の値の合計で表されます。

  ed::*file-attribute-readonly*   : 読み取り専用
  ed::*file-attribute-hidden*     : 隠しファイル
  ed::*file-attribute-system*     : システムファイル
  ed::*file-attribute-directory*  : ディレクトリ
  ed::*file-attribute-archive*    : アーカイブ
  ed::*file-attribute-compressed* : 圧縮

使用例:
  ;;; c:\autoexec.batの属性を取得してみる。多分アーカイブになっているので
  ;;; ed::*file-attribute-archive*との論理積が0以外になる。
  (get-file-attributes "c:/autoexec.bat")
  => 32
  (= (get-file-attributes "c:/autoexec.bat") ed::*file-attribute-archive*)
  => t

SeeAlso: get-file-info
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

get-disk-usage

type: Function
arguments: get-disk-usage DIRECTORY &optional RECURSIVEP
package: editor
file: builtin.l
指定されたディレクトリの容量を取得します。

  DIRECTORY  : 情報を取得するディレクトリを指定します。
  RECURSIVEP : サブディレクトリも再帰的にチェックするかを指定します。

戻り値は多値で返します。

  1 ブロックサイズ(バイト)
  2 全ディスク容量(バイト)
  3 空きディスク容量(バイト)
  4 ブロック単位の合計(バイト)
  5 ファイルサイズを単純に加算した合計(バイト)
  6 調べたディレクトリの個数
  7 調べたファイルの個数

使用例:
  (defun my-folder-size (my-dir)
    (interactive "Dfolder name: ")
    (let (my-dir-list (my-total-size  0))
      (setq my-dir-list (directory my-dir
                                   :wile "*.*"
                                   :absolute t
                                   :file-only t
                                   :recursive t
                                   :show-dots nil))
      (dolist (f my-dir-list)
        (setq my-total-size (+ my-total-size (file-length f))))
      (msgbox (format nil "フォルダの使用容量は、~d バイトです。"
                      my-total-size))))

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

format-drive

type: Function
arguments: format-drive &optional DRIVE QUICK
package: editor
file: builtin.l
ドライブをフォーマットします。

  DRIVE : ドライブを文字で指定します。

使用例:
  (format-drive #\a t)
  => nil

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

find-other-file

type: Function
arguments: find-other-file FILENAME &optional ENCODING NOMSG
package: editor
file: files.l
現在のバッファを閉じて指定されたファイルを開きます。[C-x C-v]

互換性:
  muleにはなさそう。

SeeAlso: find-file
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

find-file-read-only

type: Function
arguments: find-file-read-only FILENAME &optional ENCODING NOMSG
package: editor
file: files.l
ファイル FILENAME を read-only で開きます。
FILENAME はファイルのリストであってもかまいません。

すでに FILENAME を読み込んでいるバッファがある場合、そのバッファを read-only に設定します。
FILENAME を読み込んでいるバッファがない場合は find-file と同様にファイルを読み込み、
バッファを read-only に設定して *find-file-hooks* を実行します。

いずれの場合も最後に *find-file-read-only-hook* を実行します。

  ENCODING : エンコーディングを指定します。
  NOMSG    : non-nil ならステータスバーに経過メッセージを表示しません。

SeeAlso: find-file
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

find-file-other-window

type: Function
arguments: find-file-other-window FILENAME &optional ENCODING NOMSG
package: editor
file: files.l
指定されたファイルを別のウィンドウで開きます。[C-x 4 f]

SeeAlso: find-file
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

find-file-in-archive

type: Function
arguments: find-file-in-archive ARCNAME FILENAME
package: editor
file: files.l
アーカイブからファイルを展開して開きます。

  ARCNAME  : アーカイブを指定します。
  FILENAME : 展開するファイルを指定します。

使用例:
  (find-file-in-archive "C:/foo/bar.lzh" "hoge/fuga.txt")

SeeAlso: extract-archive
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

find-file

type: Function
arguments: find-file FILENAME &optional ENCODING NOMSG
package: editor
file: files.l
指定されたファイルを開き、カレントバッファをこのファイルにします。 [C-x C-f]
インタラクティブに呼び出すとファイル名をミニバッファで尋ねます。
プレフィックスアーギュメント付きで呼び出すと、ファイルの文字
コードを指定して開くことができます。

  FILENAME : ファイル名、またはファイル名のリストです。
  ENCODING : ファイルの文字コードを指定します。
  NOMSG    : non-nil でステータスバーに状況などを出力しなくなります。

SeeAlso: find-other-file
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

file-write-time

type: Function
arguments: file-write-time FILENAME
package: lisp
file: builtin.l
ファイルの最終更新日をユニバーサルタイム形式で返します。

  FILENAME : ファイル名を指定します。
             フルパスでなければ(default-directory)からの相対パスになります。

使用例:
  ;;; .xyzzyの最終更新日を返します。
  (file-write-time ".xyzzy")
  => 3076147256

SeeAlso: set-file-write-time
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

file-writable-p

type: Function
arguments: file-writable-p PATHNAME
package: lisp
file: builtin.l
PATHNAMEが書き込み可能ファイルならt、そうでなければnilを返します。

使用例:  
  (file-writable-p "C:/xyzzy/xyzzy.exe")
  => t
  (file-writable-p "~/")
  => nil

SeeAlso: file-readable-p
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

file-readable-p

type: Function
arguments: file-readable-p PATHNAME
package: lisp
file: builtin.l
PATHNAMEが読み取り可能ならt、そうでなければnilを返します。

使用例:
  (file-readable-p "C:/xyzzy/xyzzy.exe")
  => t
  (file-readable-p "~/")
  => nil

SeeAlso: file-writable-p
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

file-property

type: Function
arguments: file-property PATHNAME
package: editor
file: builtin.l
PATHNAMEのファイルのプロパティを表示します。
使用例:
  (setq a (merge-pathnames "xyzzy.exe" (si:system-root)))
  =>"C:/Applications/xyzzy/xyzzy.exe"

  (file-property a)
  =>t

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

file-newer-than-file-p

type: Function
arguments: file-newer-than-file-p FILE1 FILE2
package: editor
file: builtin.l
ファイルの最終更新日を比較します。
戻り値は以下のとおりです。

  t   file1の方が新しい、もしくはfile2が無効。
  nil file2の方が新しい、file1が無効、時間差が無い、のいずれか。

SeeAlso: file-write-time
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

file-namestring

type: Function
arguments: file-namestring PATHNAME
package: lisp
file: builtin.l
PATHNAMEのファイル名の部分を返します。
  
使用例:
  (file-namestring "C:/xyzzy/xyzzy.exe")
  => "xyzzy.exe"
  (file-namestring "C:/Windows/")
  => ""

須田さんの場合:
  ;;; 須田さんは、こんなのを定義しているらしい。
  (defun file-name-directory (filename)
    (directory-namestring filename))

  (defun file-name-nondirectory (filename)
    (file-namestring filename))

  (defun file-name-sans-versions (name)
    "Return FILENAME sans backup versions or strings.
  This is a separate procedure so your site-init or startup file can
  redefine it."
    (substring name 0
             (or (string-match "\\.~[0-9]+~\\'" name)
                 (string-match "~\\'" name)
                 (length name))))

SeeAlso: pathname-name
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

file-length

type: Function
arguments: file-length PATHNAME
package: lisp
file: builtin.l
指定されたファイルの大きさをバイト単位で返します。

  PATHNAME : ファイル名を指定します。

使用例:
  (file-length "C:/xyzzy/xyzzy.exe")
  => 977408

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

file-exist-p

type: Function
arguments: file-exist-p PATHNAME
package: lisp
file: builtin.l
PATHNAMEが存在すればt、そうでなければnilを返します。

使用例:  
  (file-exist-p "C:/xyzzy/xyzzy.exe")
  => t
  (file-exist-p "~/")
  => t

SeeAlso: check-valid-pathname
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

file-executable-p

type: Function
arguments: file-executable-p PATHNAME
package: lisp
file: builtin.l
注)何故か実行ファイルでも、tが返らない気がする。
PATHNAMEが実行ファイルか否かを返します。

  t    実行ファイルである。
  nil  実行ファイルではない。

SeeAlso: file-exist-p
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

file-directory-p

type: Function
arguments: file-directory-p PATHNAME
package: lisp
file: builtin.l
PATHNAMEがディレクトリならt、そうでなければnilを返します。

使用例:  
  (file-directory-p "C:/xyzzy/")
  => t
  (file-directory-p "C:/xyzzy/xyzzy.exe")
  => nil
  (file-directory-p "~/")
  => t

SeeAlso: file-exist-p
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

extract-archive

type: Function
arguments: extract-archive ARCHIVE-FILE TO-DIRECTORY &rest FILES
package: editor
file: builtin.l
アーカイブを展開します。

ARCHIVE-FILE : 展開するアーカイブを指定します。
TO-DIRECTORY : 展開するディレクトリを指定します。
FILES        : 展開するファイルを指定します。指定しない場合は、全てのフ
               ァイルが展開されます。

使用例:
  ;;; d:/foo.lzh を c:/tmp に展開します。
  (extract-archive "d:/foo.lzh" "c:/tmp")

SeeAlso: create-archive
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

emacs-write-file

type: Function
arguments: emacs-write-file FILENAME
package: editor
file: files.l
バッファの内容を FILENAME に書き込みます。
同時にバッファ名およびバッファに関連付けられたファイルも変更します。

SeeAlso: save-buffer
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

eject-media

type: Function
arguments: eject-media DRIVE
package: editor
file: builtin.l
DRIVEに指定したドライブをイジェクトします。
DRIVEはキャラクタで指定します。
使用例:
  (setq a (merge-pathnames "xyzzy.exe" (si:system-root)))
  =>"C:/Applications/xyzzy/xyzzy.exe"
  
  (eject-media (svref a 0)) ; イジェクト不可能なドライブ
  =>指定されたデバイス名は無効です。 

  (eject-media #\P)
  =>t
(svref (default-directory) 0))

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

ed::find-file-internal

type: Function
arguments: find-file-internal FILENAME &optional NOWARN (KANJI-CODE nil SVAR) NEWLINE-CODE NOMSG
package: editor
file: files.l
ファイルを開きます。find-fileはfind-file-internalを用いて実装されています。
find-fileは複数のファイルを開く機能がありますが、一つのファイルを開くの
であれば、こちらの方が高速です。

  FILENAME : ファイル名

SeeAlso: find-file
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

directory-namestring

type: Function
arguments: directory-namestring PATHNAME
package: lisp
file: builtin.l
PATHNAMEのディレクトリ部分を返します。

使用例:  
  (directory-namestring "C:/xyzzy/xyzzy.exe")
  => "C:/xyzzy/"
  (directory-namestring "~/test.txt")
  => "C:/HOME/"
  (directory-namestring "/usr/local/bin")
  => "C:/usr/local/"

SeeAlso: pathname-directory
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

directory

type: Function
arguments: directory PATHNAME &key :absolute :recursive :wild :depth :file-only :show-dots :count :directory-only :callback :file-info
package: lisp
file: builtin.l
対象ディレクトリ下のファイル名をリストで得ます。

  PATHNAME        : 検索するディレクトリのパスです。
  :absolute       : 検索結果をフルパスで取得します。
  :recursive      : サブディレクトリも対象とするかを制御します。
        t               サブディレクトリの中まで検索
        nil             サブディレクトリの中までは検索しない
  :wild           : ワイルドカード指定です。リストでも可です。
  :depth          : :recursive 指定するときの再帰の深さです。
  :file-only      : ファイルしか検索しません。
  :show-dots      : ディレクトリとして"./"と"../"を加えます。
  :count          : 表示されるファイルの個数を制限します。
  :directory-only : ディレクトリしか検索しません。
  :callback       : 見つかったファイルを引数にして funcall します。
                    funcall した結果をリストにして返します。
  :file-info      : ファイルの属性を取得します。
                    get-file-info で取得できるものと同じです。

使用例:
  ;;;  "../"は出したいけど、"./"を出したくない場合
  (delete "./" (directory ... :show-dots t) :test #'string=)

  ;;; "C:/"の配下を一覧表示する。
  (directory "C:/" :callback #'(lambda (x) (print x)))

  ;;; ファイル名のソート(大文字小文字区別有り)
  (sort (directory ...) #'string<)

  ;;; ファイル名のソート(大文字小文字区別有り)
  (sort (directory ...) #'string-lessp)

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

delete-file-in-archive

type: Function
arguments: delete-file-in-archive ARCHIVE-FILE &rest FILES
package: editor
file: builtin.l
アーカイブから指定したファイルを削除します。

  ARCHIVE-FILE : アーカイブを指定します。
  FILES        : 削除するファイルを指定します。

使用例:
  ;;; c:/tmp/foo.lzh から xyz.c を削除します。
  (delete-file-in-archive "c:/tmp/foo.lzh" "xyz.c")

SeeAlso: create-archive
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

delete-file

type: Function
arguments: delete-file FILE &key :if-does-not-exist :if-access-denied :recycle
package: lisp
file: builtin.l
ファイルを削除します。

  FILE               : 削除するファイル名を指定します。
  :if-does-not-exist : ファイルが存在しない場合の動作を指定します。
        :error          エラーを出力します。
        :skip           エラーは出力せず、nilを返します。
  :if-access-denied  : アクセスが拒否された場合の動作を指定します。
        :error          エラーを出力します。
        :skip           エラーは出力せず、nilを返します。
        :force          強制的に削除を試みます。

削除できたかどうかで戻り値が変わります。

  t   削除に成功
  nil 削除に失敗

使用例:  
  (delete-file "C:/xyzzy/test.txt")
  => t

SeeAlso: delete-directory
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

delete-directory

type: Function
arguments: delete-directory DIRNAME &key :if-does-not-exist :if-access-denied
package: lisp
file: builtin.l
ディレクトリを削除します。

  DIRNAME            : 削除するディレクトリ名を指定します。
  :if-does-not-exist : ディレクトリが存在しない場合の動作を指定します。
        :error          エラーを出力します。
        :skip           エラーは出力せず、nilを返します。
  :if-access-denied  : アクセスが拒否された場合の動作を指定します。
        :error          エラーを出力します。
        :skip           エラーは出力せず、nilを返します。
        :force          強制的に削除を試みます。

削除できたかどうかで戻り値が変わります。

  t   削除に成功
  nil 削除に失敗

使用例:
  (delete-directory "C:/xyzzy/testdir")
  => t

SeeAlso: delete-file
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

default-directory

type: Function
arguments: default-directory &optional BUFFER
package: editor
file: builtin.l
バッファが作業しているディレクトリを返します。

  BUFFER : バッファを指定します。
           指定がなければカレントバッファになります。

そのバッファでfind-file するときに最初に表示されるディレクトリのことです。
このディレクトリは M-x: cd や set-default-directoryで変更することができ
ます。

使用例:
  ;;; デフォルトディレクトリを移動してみる。
  (default-directory)
  => "C:/applications/xyzzy/site-lisp/"
  (cd "../..")
  => t
  (default-directory)
  => "C:/applications/"

SeeAlso: set-default-directory
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

cwd

type: Function
arguments: cwd
package: editor
file: builtin.l
xyzzy.exeの作業ディレクトリを返します。プロパティの作業フォルダ(S)の
ディレクトリが返されるのだと思います。

使用例: 
  (cwd)
  =>"D:/WINNT/"

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

create-shortcut-to-desktop

type: Function
arguments: create-shortcut-to-desktop PATH &rest REST
package: editor
file: files.l
デスクトップに PATH へのショートカットを作ります。

SeeAlso: create-shortcut
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

create-shortcut

type: Function
arguments: create-shortcut SRC DEST &rest REST
package: editor
file: files.l
ショートカットを作成します。

  SRC  : ショートカットが指すパスを指定します。
  DEST : ショートカットを作成するパスを指定します。
  REST : 作成するショートカットへのパラメータを与えることが出来ます。
     :description        ドラッグオーバの時やプロパティ表示時に見られる説明
     :arguments          コマンドライン引数
     :working-directory  作業ディレクトリ
     :show               ウィンドウの状態の指定
                            :show      標準のサイズで起動
                            :maximize  最大化状態で起動
                            :minimize  最小化状態で起動

使用例:
  ;;; スタートメニューにショートカットを作成する。
  (create-shortcut (merge-pathnames "xyzzy.exe" (si:system-root)) (get-special-folder-location :start-menu))
  => t
  (delete-file (merge-pathnames "xyzzy.exe.lnk" (get-special-folder-location :start-menu)))
  => t

  ;;; 送るメニューにxyzzyを登録する。
  (create-shortcut (merge-pathnames "xyzzy.exe" (si:system-root)) (get-special-folder-location :send-to))
  => t
  (delete-file (merge-pathnames "xyzzy.exe.lnk" (get-special-folder-location :send-to)))
  => t

SeeAlso: resolve-shortcut
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

create-directory

type: Function
arguments: create-directory DIRNAME &key :if-exists
package: lisp
file: builtin.l
ディレクトリを作成します。

  DIRNAME    : 作成対象のディレクトリ
  :if-exists : ディレクトリが存在していたときの動作を指定します。
        :error          エラーを出力します。
        :skip           エラーは出力せず、t を返します。

戻り値は作成できたかどうかによります。

  t   ディレクトリの作成に成功
  nil ディレクトリの作成に失敗

使用例:
  (create-directory "C:/xyzzy/testdir")
  => t

SeeAlso: delete-directory
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

create-archive

type: Function
arguments: create-archive ARCHIVE-FILE FILES BASE-DIRECTORY
package: editor
file: builtin.l
アーカイブを作成します。

  ARCHIVE-FILE   : 作成/追加する書庫ファイル名を指定します。指定したファ
                   イルが存在すれば追加、なければ新規作成します。書庫フ
                   ァイルを作成するディレクトリを指定する場合は、フルパ
                   スで指定します。
  FILES          : アーカイブするファイルのリストを指定します。フルパス
                   で指定する必要があります。
  BASE-DIRECTORY : 基準となるディレクトリを指定します。

使用例:
  ;;; foo.lzh に c:/tmp/a.c, c:/tmp/b.c を追加します。
  (create-archive "foo.lzh"
                  '("c:/tmp/a.c" "c:/tmp/b.c")
                  "c:/tmp")

SeeAlso: extract-archive
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

copy-file

type: Function
arguments: copy-file FILE NEW-FILE &key :if-exists :copy-attributes :if-access-denied
package: lisp
file: builtin.l
ファイルをコピーします。

  FILE             : コピー元のファイル名を指定します。
  NEW-FILE         : コピー先のファイル名を指定します。
  :copy-attributes : コピーするときの属性を指定します。
                     指定できる属性はget-file-infoを参照して下さい。
  :if-exists       : ファイルが存在しない場合の動作を指定します。
        :error          エラーを出力します。
        :skip           エラーは出力せず、nilを返します。
        :overwrite      強制的にファイル名の変更を試みます。
  :if-access-denied : アクセスが拒否された場合の動作を指定します。
        :error          エラーを出力します。
        :skip           エラーは出力せず、nilを返します。

使用例:
  ;;; ローカルのautoexec.batを マシン名 VENUSの /work/autoexec.batにコピーする。
  (copy-file "c:/autoexec.bat" "//VENUS/work/autoexec.bat"
             :if-exists :overwrite)

SeeAlso: rename-file
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

compile-file-pathname

type: Function
arguments: compile-file-pathname PATHNAME
package: lisp
file: builtin.l
xyzzy でバイトコンパイルした時の出力ファイル名を返します。

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

check-valid-pathname

type: Function
arguments: check-valid-pathname PATHNAME
package: lisp
file: builtin.l
PATHNAMEが存在すればt、そうでなければnilを返します。

使用例:
  ;;; 存在するC:/xyzzy/と存在しないC:/xyzzzy/を比べてみる。
  (check-valid-pathname "C:/xyzzy/")
  => t
  (check-valid-pathname "C:/xyzzzy/")
  => nil

SeeAlso: file-exist-p
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

cd

type: Function
arguments: cd DIRECTORY
package: editor
file: misc.l
バッファが作業しているディレクトリをインタラクティブに変更します。

SeeAlso: set-default-directory
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

archiver-dll-version

type: Function
arguments: archiver-dll-version DLL
package: editor
file: builtin.l
アーカイバのバージョンを取得します。

  DLL  : アーカイバを指定します。

使用例:
  (archiver-dll-version :unrar32)
  => "0.09"

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

archiver-dll-config-dialog

type: Function
arguments: archiver-dll-config-dialog DLL &optional MODE
package: editor
file: builtin.l
アーカイバの設定ダイアログを表示します。

  DLL  : 設定するアーカイバを指定します。
  MODE : (詳細不明)

使用例:
  (archiver-dll-config-dialog :unlha32)

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

append-trail-slash

type: Function
arguments: append-trail-slash STRING
package: editor
file: builtin.l
文字列の末尾に"/"がなければ"/"を追加します。

使用例:
  (append-trail-slash "ffjfj")
  => "ffjfj/"
  (append-trail-slash "ffjfj/")
  => "ffjfj/"

SeeAlso: remove-trail-slash
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

append-file

type: Function
arguments: append-file FILENAME &optional NOMSG CHAR-ENCODING EOL-CODE
package: editor
file: files.l
バッファの内容を FILENAME に追加書き込みします。
write-file で APPEND を non-nil にした場合と同じです。

  NOMSG         : non-nil ならステータスバーに経過メッセージを表示しません。
  CHAR-ENCODING : エンコーディングを指定します。
  EOL-CODE      : 改行コードを指定します。

SeeAlso: write-file
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

*load-pathname*

type: Variable
package: lisp
現在読み込み中のファイル名(もしくはストリーム名)が入ります。

load-file内でバインドされます。

[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

*find-other-file-requires-file-name*

type: Variable
package: editor
file: files.l
non-nil なら find-other-file のプロンプト時に現在のバッファ名を表示します。

SeeAlso: find-other-file
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

*find-file-read-only-hook*

type: Variable
package: editor
file: files.l
find-file-read-only でファイルごとに最後に実行されます。
*find-file-hooks* と異なり、すでにファイルが開かれていた場合にも実行されます。

SeeAlso: *find-file-hooks*
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

*find-file-no-auto-encoding*

type: Variable
package: editor
file: files.l
non-nil なら、*auto-encoding-alist* によるエンコーディングの判定を行いません。

SeeAlso: *auto-encoding-alist*
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

*find-file-hooks*

type: Variable
package: editor
file: files.l
find-file および find-file-read-only で新しいファイルを開くたびに、最後に実行されます。
すでにファイルを開いているバッファが存在した場合には実行されません。

SeeAlso: *find-file-read-only-hook*
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

*default-write-file-directory*

type: Variable
package: editor
file: files.l
write-file および emacs-write-file 時のデフォルトのディレクトリを指定します。

SeeAlso: emacs-write-file
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

*auto-update-per-device-directory*

type: Variable
package: lisp
ファイラで移動したときにドライブ毎のデフォルトのディレクトリについて制御します。

  t   移動するたびに更新する
  nil set-perdevice-directoryで指定したディレクトリに固定する

SeeAlso: set-per-device-directory
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]

*auto-encoding-alist*

type: Variable
package: editor
file: files.l
エンコーディング判定用の連想リストです。(key . datum) の組で登録します。
find-file または find-file-read-only の際に ENCODING が指定されず、
*find-file-no-auto-encoding* が nil の時、
(string-matchp key filename) が non-nil となった場合、datum をfuncallします。
datum にはエンコーディングもしくはエンコーディングを表す文字列を返す関数を指定します。

SeeAlso: *find-file-no-auto-encoding*
[ Intro | 目次 | 索引 | 目的別 | ファイルシステム ]