Filesys-DiskUsage-0.02 > Filesys::DiskUsage
Filesys-DiskUsage-0.02

名前

Filesys::DiskUsage - Estimate file space usage (similar to `du`)

Filesys::DiskUsage - duと類似した用い方でファイルスペースを見積もる

概要

  use Filesys::DiskUsage qw/du/;

  # basic
  $total = du(qw/file1 file2 directory1/);

or

  # no recursion
  $total = du( { recursive => 0 } , <*> );

or

  # max-depth is 1
  $total = du( { 'max-depth' => 1 } , <*> );

or

  # get an array
  @sizes = du( @files );

or

  # get a hash
  %sizes = du( { 'make-hash' => 1 }, @files_and_directories );

関数

du

Estimate file space usage.

ファイルスペースを見積もる為の用い方

Get the size of files:

複数ファイルのサイズを取得する:

  $total = du(qw/file1 file2/);

Get the size of directories:

ディレクトリのサイズを取得する:

  $total = du(qw/file1 directory1/);

オプション

dereference

Follow symbolic links. Default is 0.

シンボリックリンクをたどる. デフォルトでは0.

Get the size of a directory, recursively, following symbolic links:

シンボリックリンクを再帰的にたどりディレクトリのサイズを取得する:

  $total = du( { dereference => 1 } , $dir );
exclude => PATTERN

Exclude files that match PATTERN.

PATTERNに一致したファイルを除く.

Get the size of every file except for dot files:

ドットファイルを除いた全てのファイルのサイズを取得する:

  $total = du( { exclude => qr/^\./ } , @files );
human-readable

Return sizes in human readable format (e.g., 1K 234M 2G)

人が読みやすいフォーマットでサイズを返す (e.g., 1K 234M 2G)

  $total = du ( { 'human-readable' => 1 } , @files );
Human-readable

Return sizes in human readable format, but use powers of 1000 instead of 1024.

人が読みやすいフォーマットでサイズを返すが1024の代わりに1000を使用する.

  $total = du ( { 'Human-readable' => 1 } , @files );
make-hash

Return the results in a hash.

ハッシュで結果を返す.

  %sizes = du( { 'make-hash' => 1 } , @files );
max-depth

Sets the max-depth for recursion. A negative number means there is no max-depth. Default is -1.

再帰させる最大深度を設定する.マイナスの数値は深度がないことを意味している. デフォルトでは-1です.

Get the size of every file in the directory and immediate subdirectories:

ディレクトリとサブディレクトリにある全てのファイルのサイズを取得する:

  $total = du( { 'max-depth' => 1 } , <*> );
recursive

Sets whether directories are to be explored or not. Set to 0 if you don't want recursion. Default is 1. Overrides max-depth.

調査するディレクトリであろうがなかろうがセットする. 再帰させたくない場合は0をセットして下さい. デフォルトでは1です.max-depthをオーバーライドします.

Get the size of every file in the directory, but not directories:

ディレクトリではなくディレクトリにある全てのファイルのサイズを取得する:

  $total = du( { recursive => 0 } , <*> );
truncate-readable => NUMBER

Human readable formats decimal places are truncated by the value of this option. A negative number means the result won't be truncated at all. Default if 2.

このオプションの値で人が読みやすいフォーマットの10進桁数は端が欠けます. マイナスの数値は桁の端が全く欠けないことを意味します. デフォルトは2です.

Get the size of a file in human readable format with three decimal places:

少数第3位の人が読みやすいフォーマットでファイルサイズを取得します.

  $size = du( { 'human-readable' => 1 , 'truncate-readable' => 3 } , $file);

作者

Jose Castro, <cog@cpan.org>

バグ

Please report any bugs or feature requests to bug-disk-usage@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Copyright 2004 Jose Castro, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

翻訳者

 atsushi kobayashi(nekokak@users.sourceforge.jp)