namespace hamigaki {
namespace filesystem {
// status functions
file_status status(const boost::filesystem::path&, int&);
file_status status(const boost::filesystem::path&);
file_status symlink_status(const boost::filesystem::path&, int&);
file_status symlink_status(const boost::filesystem::path&);
// predicate functions
bool exists(const boost::filesystem::path&);
bool is_regular(const boost::filesystem::path&);
bool is_directory(const boost::filesystem::path&);
bool is_other(const boost::filesystem::path&);
bool is_symlink(const boost::filesystem::path&);
// attribute functions
boost::filesystem::path symlink_target(const boost::filesystem::path&);
void last_write_time(const boost::filesystem::path&, const timestamp&);
void last_access_time(const boost::filesystem::path&, const timestamp&);
void creation_time(const boost::filesystem::path&, const timestamp&);
// operations functions
int create_hard_link(const boost::filesystem::path&,
const boost::filesystem::path&, int&);
void create_hard_link(const boost::filesystem::path&,
const boost::filesystem::path&);
int create_file_symlink(const boost::filesystem::path&,
const boost::filesystem::path&, int&);
void create_file_symlink(const boost::filesystem::path&,
const boost::filesystem::path&);
int create_directory_symlink(const boost::filesystem::path&,
const boost::filesystem::path&, int&);
void create_directory_symlink(const boost::filesystem::path&,
const boost::filesystem::path&);
int create_symlink(const boost::filesystem::path&,
const boost::filesystem::path&, int&);
void create_symlink(const boost::filesystem::path&,
const boost::filesystem::path&);
void change_attributes(const boost::filesystem::path&,
file_attributes::value_type, int&);
void change_attributes(const boost::filesystem::path&,
file_attributes::value_type);
void change_permissions(const boost::filesystem::path&,
file_permissions::value_type, int&);
void change_permissions(const boost::filesystem::path&,
file_permissions::value_type);
int change_owner(const boost::filesystem::path&,
const boost::optional<boost::intmax_t>&,
const boost::optional<boost::intmax_t>&, int&);
void change_owner(const boost::filesystem::path&,
const boost::optional<boost::intmax_t>&,
const boost::optional<boost::intmax_t>&);
int change_symlink_owner(const boost::filesystem::path&,
const boost::optional<boost::intmax_t>&,
const boost::optional<boost::intmax_t>&, int&);
void change_symlink_owner(const boost::filesystem::path&,
const boost::optional<boost::intmax_t>&,
const boost::optional<boost::intmax_t>&);
unsigned long remove_all(const boost::filesystem::path&);
// MS Windows specific functions
int create_shell_link(const boost::filesystem::path&,
const boost::filesystem::path&, int&);
void create_shell_link(const boost::filesystem::path&,
const boost::filesystem::path&);
}
}
status functions
-
file_status status(const boost::filesystem::path& p, int& ec);
Effects:
|
パスp のファイル状態情報を調べる。ファイルが見つからない場合は、ファイルの種類はfile_not_found になる。それ以外のエラーが発生した場合は、ファイルの種類はstatus_unknown になり、ec にシステム依存のエラーコードを設定する。 |
Returns:
|
パスp のファイル状態情報 |
-
file_status status(const boost::filesystem::path& p);
Effects:
|
int ec;
file_status stat(status(p, ec));
|
Throws:
|
ec が0でない場合、boost::filesystem::filesystem_error |
Returns:
|
stat
|
-
file_status symlink_status(const boost::filesystem::path& p, int& ec);
Effects:
|
パスp がシンボリックである場合、シンボリックリンク自体のファイル状態情報を返す。それ以外の場合は、status(p) と同じ効果とする。 |
Returns:
|
パスp のファイル状態情報 |
-
file_status symlink_status(const boost::filesystem::path& p);
Effects:
|
int ec;
file_status stat(symlink_status(p, ec));
|
Throws:
|
ec が0でない場合、boost::filesystem::filesystem_error |
Returns:
|
stat
|
predicate functions
-
bool exists(const boost::filesystem::path& p);
Returns:
|
exists(status(p))
|
-
bool is_regular(const boost::filesystem::path& p);
Returns:
|
is_regular(status(p))
|
-
bool is_directory(const boost::filesystem::path& p);
Returns:
|
is_directory(status(p))
|
-
bool is_other(const boost::filesystem::path& p);
Returns:
|
is_other(status(p))
|
-
bool is_symlink(const boost::filesystem::path& p);
Returns:
|
is_symlink(symlink_status(p))
|
attribute functions
-
boost::filesystem::path symlink_target(const boost::filesystem::path& p);
Returns:
|
パスp のシンボリックリンクのターゲットパス |
-
void last_write_time(const boost::filesystem::path& p,
const timestamp& new_time);
Effects:
|
パスp のファイル最終更新時間をnew_time に変更する |
-
void last_access_time(const boost::filesystem::path& p,
const timestamp& new_time);
Effects:
|
パスp のファイル最終アクセス時間をnew_time に変更する |
-
void creation_time(const boost::filesystem::path& p,
const timestamp& new_time);
Effects:
|
パスp のファイル作成時間をnew_time に変更する |
operations functions
-
int create_hard_link(const boost::filesystem::path& old_fp,
const boost::filesystem::path& new_fp, int& ec);
Effects:
|
パスnew_fp で、パスold_fp へのハードリンクを作成する。成功した場合は、ec には0が設定される。エラーが発生した場合は、ec にシステム依存のエラーコードを設定する。 |
Returns:
|
ec
|
-
void create_hard_link(const boost::filesystem::path& old_fp,
const boost::filesystem::path& new_fp);
Effects:
|
int ec;
create_hard_link(old_fp, new_fp, ec);
|
Throws:
|
ec が0でない場合、boost::filesystem::filesystem_error |
-
int create_file_symlink(const boost::filesystem::path& old_fp,
const boost::filesystem::path& new_fp, int& ec);
Effects:
|
パスnew_fp で、ファイルold_fp へのシンボリックリンクを作成する。成功した場合は、ec には0が設定される。エラーが発生した場合は、ec にシステム依存のエラーコードを設定する。 |
Returns:
|
ec
|
-
void create_file_symlink(const boost::filesystem::path& old_fp,
const boost::filesystem::path& new_fp);
Effects:
|
int ec;
create_file_symlink(old_fp, new_fp, ec);
|
Throws:
|
ec が0でない場合、boost::filesystem::filesystem_error |
-
int create_directory_symlink(const boost::filesystem::path& old_dp,
const boost::filesystem::path& new_dp, int& ec);
Effects:
|
パスnew_dp で、ディレクトリold_dp へのシンボリックリンクを作成する。成功した場合は、ec には0が設定される。エラーが発生した場合は、ec にシステム依存のエラーコードを設定する。 |
Returns:
|
ec
|
-
void create_directory_symlink(const boost::filesystem::path& old_fp,
const boost::filesystem::path& new_fp);
Effects:
|
int ec;
create_directory_symlink(old_fp, new_fp, ec);
|
Throws:
|
ec が0でない場合、boost::filesystem::filesystem_error |
-
int create_symlink(const boost::filesystem::path& old_fp,
const boost::filesystem::path& new_fp, int& ec);
Effects:
|
POSIXでは、create_file_symlink(old_fp, new_fp, ec) と同じ効果とする。Windowsでは、パスold_fp がファイルであればcreate_file_symlink(old_fp, new_fp, ec) 、ディレクトリであればcreate_directory_symlink(old_fp, new_fp, ec) を呼び出した場合と同じ効果とする。Windowsでパスold_fp が存在しない場合は、ec にはERROR_PATH_NOT_FOUND が設定される。 |
Returns:
|
ec
|
-
void create_symlink(const boost::filesystem::path& old_fp,
const boost::filesystem::path& new_fp);
Effects:
|
int ec;
create_symlink(old_fp, new_fp, ec);
|
Throws:
|
ec が0でない場合、boost::filesystem::filesystem_error |
-
void change_attributes(const boost::filesystem::path& p,
file_attributes::value_type attr, int& ec);
引数attr
には、file_attributes
構造体内の定数のいずれか、あるいはその組み合わせを指定する。但し、ファイル種別を示すtype_mask
部分は無視される。
Effects:
|
パスp のファイル属性をattr に変更する。成功した場合は、ec には0が設定される。エラーが発生した場合は、ec にシステム依存のエラーコードを設定する。 |
-
void change_attributes(const boost::filesystem::path& p,
file_attributes::value_type attr);
Effects:
|
int ec;
change_attributes(p, attr, ec);
|
Throws:
|
ec が0でない場合、boost::filesystem::filesystem_error |
-
void change_permissions(const boost::filesystem::path& p,
file_permissions::value_type perm, int& ec);
引数perm
には、file_permissions
構造体内の定数のいずれか、あるいはその組み合わせを指定する。但し、ファイル種別を示すtype_mask
部分は無視される。
Effects:
|
パスp のファイル許可属性をperm に変更する。成功した場合は、ec には0が設定される。エラーが発生した場合は、ec にシステム依存のエラーコードを設定する。 |
-
void change_permissions(const boost::filesystem::path& p,
file_permissions::value_type perm);
Effects:
|
int ec;
change_permissions(p, perm, ec);
|
Throws:
|
ec が0でない場合、boost::filesystem::filesystem_error |
-
int change_owner(const boost::filesystem::path& p,
const boost::optional<boost::intmax_t>& new_uid,
const boost::optional<boost::intmax_t>& new_gid, int& ec);
Effects:
|
パスp のオーナーをnew_uid にグループをnew_gid に変更する。成功した場合は、ec には0が設定される。エラーが発生した場合は、ec にシステム依存のエラーコードを設定する。 |
Returns:
|
ec
|
-
void change_owner(const boost::filesystem::path& p,
const boost::optional<boost::intmax_t>& new_uid,
const boost::optional<boost::intmax_t>& new_gid);
Effects:
|
int ec;
change_owner(p, new_uid, new_gid, ec);
|
Throws:
|
ec が0でない場合、boost::filesystem::filesystem_error |
-
int change_symlink_owner(const boost::filesystem::path& p,
const boost::optional<boost::intmax_t>& new_uid,
const boost::optional<boost::intmax_t>& new_gid,
int& ec);
Effects:
|
パスp がシンボリックリンクの場合にシンボリック自身に作用することを除き、change_owner(p, new_uid, new_gid, ec) と同じ効果とする。 |
Returns:
|
ec
|
-
void change_symlink_owner(const boost::filesystem::path& p,
const boost::optional<boost::intmax_t>& new_uid,
const boost::optional<boost::intmax_t>& new_gid);
Effects:
|
int ec;
change_symlink_owner(p, new_uid, new_gid, ec);
|
Throws:
|
ec が0でない場合、boost::filesystem::filesystem_error |
-
unsigned long remove_all(const boost::filesystem::path& p);
Effects:
|
パスp 以下のファイルを再帰的に削除する。 |
Notes:
|
シンボリックリンクの削除にターゲットファイルは影響されない。 |
Returns:
|
削除したファイル/ディレクトリの数 |
MS Windows specific functions
-
int create_shell_link(const boost::filesystem::path& old_fp,
const boost::filesystem::path& new_fp, int& ec);
Effects:
|
パスnew_fp で、パスold_fp へのシェルリンク(ショートカットファイル)を作成する。成功した場合は、ec には0が設定される。エラーが発生した場合は、ec にシステム依存のエラーコードを設定する。 |
Returns:
|
ec
|
-
void create_shell_link(const boost::filesystem::path& old_fp,
const boost::filesystem::path& new_fp);
Effects:
|
int ec;
create_shell_link(old_fp, new_fp, ec);
|
Throws:
|
ec が0でない場合、boost::filesystem::filesystem_error |