Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"An ounce of prevention is worth a ton of code." -- an anonymous programmer


devel / comp.os.ms-windows.programmer.win32 / Re: ReadFile - how to detect EOF ?

SubjectAuthor
* Re: ReadFile - how to detect EOF ?Christian Astor
`* Re: ReadFile - how to detect EOF ?R.Wieser
 `* Re: ReadFile - how to detect EOF ?holyghost
  `- Re: ReadFile - how to detect EOF ?R.Wieser

1
Re: ReadFile - how to detect EOF ?

<s8to1d$1i14$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=177&group=comp.os.ms-windows.programmer.win32#177

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!47jZ8yXbWXV7kuM4CaIY1Q.user.gioia.aioe.org.POSTED!not-for-mail
From: castorix@club-internet.fr (Christian Astor)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: ReadFile - how to detect EOF ?
Date: Sat, 29 May 2021 17:53:19 +0200
Organization: Aioe.org NNTP Server
Lines: 29
Message-ID: <s8to1d$1i14$1@gioia.aioe.org>
References: <s7rh1o$1b8k$1@gioia.aioe.org>
NNTP-Posting-Host: 47jZ8yXbWXV7kuM4CaIY1Q.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299
X-Notice: Filtered by postfilter v. 0.9.2
 by: Christian Astor - Sat, 29 May 2021 15:53 UTC

You can see MSDN :
https://docs.microsoft.com/en-us/windows/win32/fileio/testing-for-the-end-of-a-file

R.Wieser a écrit :
> Hello all,
>
> I'm reading a file synchronously and non-overlapped using ReadFile. I'm
> also reading the file blockwise, and do not want to deal with an empty block
> when the filesize turns out to be an exact multiple of the blocksize (every
> block must contain data).
>
> IOW, how do I detect the EOF /without/ trying to use ReadFile and getting
> zero bytes back.
>
> I've tried a ReadFile of zero bytes, but that doesn't quite work. :-\
>
> I can ofcourse get and store the filesize beforehand and for each block
> subtract the ammount of bytes read, but that means I have duplicate data :
> a file that ends and a counter that /should/ than be zero. Which I would
> rather not have.
>
> I've ofcourse already DDGed the intarwebz for a hint, but have had not luck.
>
> Regards,
> Rudy Wieser
>
>

Re: ReadFile - how to detect EOF ?

<s8tplo$cdn$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=178&group=comp.os.ms-windows.programmer.win32#178

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!47jZ8yXbWXV7kuM4CaIY1Q.user.gioia.aioe.org.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: ReadFile - how to detect EOF ?
Date: Sat, 29 May 2021 17:53:19 +0200
Organization: Aioe.org NNTP Server
Lines: 29
Message-ID: <s8to1d$1i14$1@gioia.aioe.org>
References: <s7rh1o$1b8k$1@gioia.aioe.org>
NNTP-Posting-Host: 47jZ8yXbWXV7kuM4CaIY1Q.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299
X-Notice: Filtered by postfilter v. 0.9.2
 by: R.Wieser - Sat, 29 May 2021 16:20 UTC

Christian,

> You can see MSDN :
> https://docs.microsoft.com/en-us/windows/win32/fileio/testing-for-the-end-of-a-file

Yeah, I found that too. The problem with it is that you *have to read data*
to be able to detect there isn't any more of it.

IOW, if I want to mark the current full block of data as the last one I must
have already read (some of) the next block able to determine the EOF status.
And thats something I'd rather not do.

Regards,
Rudy Wieser

Re: ReadFile - how to detect EOF ?

<614d4a1f$0$694$14726298@news.sunsite.dk>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=223&group=comp.os.ms-windows.programmer.win32#223

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!47jZ8yXbWXV7kuM4CaIY1Q.user.gioia.aioe.org.POSTED!not-for-mail
From: automn.willow@gmail.com (holyghost)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: ReadFile - how to detect EOF ?
Date: Sat, 29 May 2021 17:53:19 +0200
Organization: Aioe.org NNTP Server
Lines: 29
Message-ID: <s8to1d$1i14$1@gioia.aioe.org>
References: <s7rh1o$1b8k$1@gioia.aioe.org>
NNTP-Posting-Host: 47jZ8yXbWXV7kuM4CaIY1Q.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299
X-Notice: Filtered by postfilter v. 0.9.2
 by: holyghost - Fri, 24 Sep 2021 03:46 UTC

On 5/29/2021 6:20 PM, R.Wieser wrote:
> Christian,
>
>> You can see MSDN :
>> https://docs.microsoft.com/en-us/windows/win32/fileio/testing-for-the-end-of-a-file
>
> Yeah, I found that too. The problem with it is that you *have to read data*
> to be able to detect there isn't any more of it.
>
> IOW, if I want to mark the current full block of data as the last one I must
> have already read (some of) the next block able to determine the EOF status.
> And thats something I'd rather not do.
>
> Regards,
> Rudy Wieser
>
>

Maybe use streams and the "<<", ">>" operators. Then by reading your
previous posts buy K&R (ANSI C) and Strousstrup (The C++ programming
language) books. It will help you a lot.

holly

--
(__)
oo )
|_/\

My Software & Art company (donations are welcome) :
https://ko-fi.com/brandywine9

Re: ReadFile - how to detect EOF ?

<sik67i$1d13$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=224&group=comp.os.ms-windows.programmer.win32#224

  copy link   Newsgroups: comp.os.ms-windows.programmer.win32
Path: i2pn2.org!i2pn.org!aioe.org!47jZ8yXbWXV7kuM4CaIY1Q.user.gioia.aioe.org.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.ms-windows.programmer.win32
Subject: Re: ReadFile - how to detect EOF ?
Date: Sat, 29 May 2021 17:53:19 +0200
Organization: Aioe.org NNTP Server
Lines: 29
Message-ID: <s8to1d$1i14$1@gioia.aioe.org>
References: <s7rh1o$1b8k$1@gioia.aioe.org>
NNTP-Posting-Host: 47jZ8yXbWXV7kuM4CaIY1Q.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299
X-Notice: Filtered by postfilter v. 0.9.2
 by: R.Wieser - Fri, 24 Sep 2021 09:21 UTC

holyghost,

> Maybe use streams and the "<<", ">>" operators.

Alas, I'm not using C{something}to program in.

Regards,
Rudy Wieser


devel / comp.os.ms-windows.programmer.win32 / Re: ReadFile - how to detect EOF ?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor