回答編集履歴
2
追記
answer
CHANGED
@@ -4,4 +4,6 @@
|
|
4
4
|
> Files that are opened by fopen_s and _wfopen_s are not sharable. If you require that a file be sharable, use _fsopen, _wfsopen with the appropriate sharing mode constant—for example, _SH_DENYNO for read/write sharing.
|
5
5
|
|
6
6
|
とあります。(日本語訳があやしいので、原文で引用しました)
|
7
|
-
簡単に言うとfopen_fで開いたファイルは共有できないので、共有したい場合は_fsopenを使いましょうとのことです。
|
7
|
+
簡単に言うとfopen_fで開いたファイルは共有できないので、共有したい場合は_fsopenを使いましょうとのことです。
|
8
|
+
|
9
|
+
fprintfで書き込んでも即時にファイルに反映されないので、必要に応じてfflushするなりしてください。
|
1
追記
answer
CHANGED
@@ -1,1 +1,7 @@
|
|
1
|
-
FileShare.ReadWriteを指定しても読み込めないのであれば、書き込む側を変更するしかないかと思います。
|
1
|
+
FileShare.ReadWriteを指定しても読み込めないのであれば、書き込む側を変更するしかないかと思います。
|
2
|
+
|
3
|
+
ログの出力側で`fopen_s`で開いているとのことですが、[こちら](https://docs.microsoft.com/ja-jp/cpp/c-runtime-library/reference/fopen-s-wfopen-s?view=vs-2019)に
|
4
|
+
> Files that are opened by fopen_s and _wfopen_s are not sharable. If you require that a file be sharable, use _fsopen, _wfsopen with the appropriate sharing mode constant—for example, _SH_DENYNO for read/write sharing.
|
5
|
+
|
6
|
+
とあります。(日本語訳があやしいので、原文で引用しました)
|
7
|
+
簡単に言うとfopen_fで開いたファイルは共有できないので、共有したい場合は_fsopenを使いましょうとのことです。
|