0
0

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.

c++ builder XE4, 10.2 Tokyo > fileIO > TDirectory::GetFiles() > 対象フォルダが存在しない時は例外を発生する

Last updated at Posted at 2015-12-03
動作確認
C++ Builder XE4
Rad Studio 10.2 Tokyo Update 2 (追記: 2017/12/27)

TDirectory::GetFiles()関連で例外が発生していたので調べた。
対象フォルダが存在していない時に例外が発生している。

ヘルプを見ると

メモ: 指定のパスが無効であるか、またはそのディレクトリが存在しない場合、GetFiles は例外を発生させます。

try, catch()で対応することになりそう。

関数のAPIとして対象フォルダが存在しない時、以下のうち2の方が良いように思う。例外を発生させる利点は未消化。

  1. 例外を発生させる
  2. 0個のリストとして返す

メモ: 指定のパスが無効であるか、またはそのディレクトリが存在しない場合、GetFiles は例外を発生させます。

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?