zed
zed
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
It only accesses it partially
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
The inner method (which is where the above code happened) does not own the stream
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
This is a complicated file reading harness that handles a bunch of issues
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
Because it's being closed later
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
But it's all good now 👍
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
But my issue was why it didn't throw an exception, along with some observational failures on my part
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
The stream needs to remain open in my case, it's being closed by our file reading harness outside of that method
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
Same, but good to know
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
Thanks for the help, as usual 🫡
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
Read is the correct share permission here anyway, no idea why it was ReadWrite
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
Still not sure how I feel about that behavior by the reader 😅 But explains it, and easy to change
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
And the reader then just produced an empty output
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
Which the stream accepted
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
And another program was writing
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
I opened the stream with ReadWrite sharing permissions
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
Ok, I figured it out, and in retrospect, it's kinda obvious... though I still dislike that behavior by the reader
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
I'll see if modifying the Stream constructor would help get that exception later on
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
System.IO.IOException: 'The process cannot access the file 'C:\Code\...' because it is being used by another process.'
System.IO.IOException: 'The process cannot access the file 'C:\Code\...' because it is being used by another process.'
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
One difference is that it uses a different Stream constructor
57 replies
CC#
Created by zed on 4/17/2025 in #help
✅ StreamReader returns empty string on valid file stream
IOException, I can get you the error message in a sec
57 replies