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 3 years have passed since last update.

Windowsのファイル操作

Last updated at Posted at 2020-10-31

Windows環境プログラムからファイルの作成に失敗していて、プロセスモニタで調査した結果、ファイル作成時にDELETE PENDINGが発生していた。

Visual Studio 2019でコンパイルしたらCreateFileの第一引数で「"char *" の引数は型 "LPCWSTR" のパラメーターと互換性がありません」とエラーになった。

ソリューションエクスプローラからプロジェクトのプロパティを表示し、[構成プロパティ]-[詳細]を選択し、「文字セット」の値を【Unicode文字セットを使用する】から【マルチバイト文字セットを使用する】に変更した。

ただ、思った通りの動きにならない。原因調査中に以下のサイトを見つけた。
https://mattn.kaoriya.net/software/lang/go/20170817113831.htm

Windows Server2016では想定通りに動いたので、やはりWindows10で挙動が変わったようだ。(確認したWindows10はバージョン2004)

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?