0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

fileIO > ファイルの日付 > 取得方法によるファイル日付の違い > コピー処理に注意

Last updated at Posted at 2016-10-25
動作環境
Windows 7 pro

Dropboxに限らないかもしれないが、フォルダ階層を持つファイルをzip圧縮したものを取得した場合。

  1. zip圧縮ファイルを解凍し移動
    • ファイル更新日時は「元の日時」のまま
  2. zip圧縮ファイルを解凍しコピー
    • ファイル更新日時は「現在の日時」になる

上記の2つの場合において、「ファイル更新日時をチェックして最近1週間のファイルをコピー」処理をした時

  1. すべてのファイルをコピー
    • 例:700MBのコピーが発生
  2. 最近1週間のファイルのコピー
    • 例:数MBのコピー

運用上は2の処理になると思われるが、1のようなファイルの取得をした場合は処理が固まったようになる。

ファイルコピー時のプログレスバーを表示するなど何らかの検討が必要かもしれない。

ファイルやフォルダの命名規則に日時情報を含む場合はそれをコピー時のファイル選択に使えばいいが、一方でそれをするとコピー処理の汎用性はなくなる。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?