ファイルの書き込み中にエラーが発生し、頭がおかしくなりました。
RH Linux で C# netcore 5 アプリケーションを実行しています。
次を使用して共有フォルダー (windows) をマウントしました。次に、
読み取り/書き込みテストsudo mount -t cifs -o username=MyDomainUsername,password=MyDomainUsernamePassword,domain=MyDomain,dir_mode=0777,file_mode=0777 //ipv4_from_destination/Reports /fileshare/Reports
のみを使用してアプリを実行します。次の手順を実行します。./WebApi --urls=http://+:8060
- テキスト ファイルを作成します。
- テキストファイルを書き込みます。
- テキストファイルを削除します。
- ディレクトリを作成します
- そのディレクトリ内にテキストファイルを作成します
- テキストファイルを書き込みます
- テキストファイルを削除します
- ディレクトリを削除します。
今問題:
- テキストファイルが作成されます
- 書き込み操作は失敗します。
ログの一部は次のとおりです。
Creating file: /fileshare/Reports/test.616db7d1-07fb-4599-a0cf-749e6a8b34ec.tmp...Ok
Writing file: /fileshare/Reports/test.616db7d1-07fb-4599-a0cf-749e6a8b34ec.tmp...[16:22:20 ERR] ID:87988856-a765-4474-9ed9-2f04aef35771 PATH:/api/about ERROR:System.UnauthorizedAccessException:Access to the path '/fileshare/Reports/test.616db7d1-07fb-4599-a0cf-749e6a8b34ec.tmp' is denied. TRACE: at System.IO.FileStream.WriteNative(ReadOnlySpan`1 source)
at System.IO.FileStream.FlushWriteBuffer()
at System.IO.FileStream.FlushInternalBuffer()
at System.IO.FileStream.Flush(Boolean flushToDisk)
at System.IO.FileStream.Flush()
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Flush()
at WebApi.Controllers.ApplicationController.TestFileSystem(String folder) in xxxxxxx\WebApi\Controllers\ApplicationController.cs:line 116
これまでに発見したこと:
ファイルとディレクトリを作成および削除できます。
ファイルに書き込めません。
誰かが私にこれについてのヒントを教えてもらえますか?