Click here to Skip to main content
16,004,647 members

Comments by Yount_0701 (Top 57 by date)

Yount_0701 11-May-24 7:37am View    
I tested and figured out that `That can't be the underlying issue; you must be hitting an issue with the write part.` as you said before was NOT CORRECT.
If you open file with zero-share-mode and not close the file handle, you tried to open the same file again somewhere or other process , you will meet the ERROR_SHARING_VIOLATION issue. Even if you use `CopyFile` function , the problem would be the same because copy file also need to open the file. If you use windows notepad to open the same file before the file handle was closed , same warnings would popup. And Yes I tested. The File System restrict that kind of operations. You need to close the file handle first and then re-open it, or you should not use zero-share-mode.
Yount_0701 11-May-24 3:49am View    
`CopyFile is a none-blocking file on the read operation. That can't be the underlying issue; you must be hitting an issue with the write part. ` I have been coding and test , that's NOT TRUE. `CopyFile` also need to read the file content, which as you referred below , zero-share mode file in use CAN NOT been copied , and the error code would be ERROR_SHARING_VIOLATION.
Yount_0701 10-May-24 18:41pm View    
Memory always faster then storage. Ring buffer chain has been applied to many places. My coding right now is not that much required about performance yet, maybe the next step to think about later. But your ideal still a good try as I see. My problem is , my code still not working so far , because of zero-shared open mode as referred.
Yount_0701 10-May-24 6:01am View    
`That can't be the underlying issue; you must be hitting an issue with the write part.`
Thank you , that's a confirm, I like this kind of talk . @Pete O'Hanlon and @CPallini
If so , something was wrong with my coding logic. I'm gonna to figure it out.
Yount_0701 10-May-24 5:52am View    
I prefer to pesume if there is a way to open a file in use by another program and read the content properly. Your suggestion may be right , but lead to different path away from my thoughts.