![]() |
![]() |
#12 | |
"Mihai Preda"
Apr 2015
101001101012 Posts |
![]() Quote:
|
|
![]() |
![]() |
![]() |
#13 | ||
"Mihai Preda"
Apr 2015
31×43 Posts |
![]() Quote:
In my case, when I run without newlines, I get this expected behavior: Quote:
|
||
![]() |
![]() |
![]() |
#14 |
Undefined
"The unspeakable one"
Jun 2006
My evil lair
10111011010102 Posts |
![]()
Why so OCD?
Just place a LF (or CRLF) on the end of every text file you load into memory. Then you don't have to treat the user to an unnecessary error. Last fiddled with by retina on 2020-10-24 at 02:14 |
![]() |
![]() |
![]() |
#15 | |
"Mihai Preda"
Apr 2015
31×43 Posts |
![]() Quote:
OTOH if it's not guaranteed that the file ends with \n, you have two options: 1. always add a '\n' just to be sure -- then the user is surprised by the many empty lines. 2. read and analyze the file, and take different actions depending on how it's ended. |
|
![]() |
![]() |
![]() |
#16 |
Undefined
"The unspeakable one"
Jun 2006
My evil lair
2×34×37 Posts |
![]() |
![]() |
![]() |
![]() |
#17 | |
"Mihai Preda"
Apr 2015
31·43 Posts |
![]() Quote:
If the file ends with "AAA" without newline, and I append "BBB\n", now the file contains "AAABBB\n" as the last line. That's not what anybody wants. |
|
![]() |
![]() |
![]() |
#18 | |
Undefined
"The unspeakable one"
Jun 2006
My evil lair
2·34·37 Posts |
![]() Quote:
If you just want to make the users mad then you can make the code super fussy and generate error conditions like you do now. But to me it seems silly to tell the user to edit the file and put in a LF, when the code could do that itself without any fuss and then keep working as expected. |
|
![]() |
![]() |
![]() |
#19 |
Aug 2020
1001012 Posts |
![]()
The problem is very easy to replicate. Just cut one or more lines from the manual assignments server page and past them into the worktodo.txt file. When reading the file, gpuowl-win.exe will stop unless you hit enter at the last line before saving. There may be differences between Windows and Linux in handling CR/LF.
|
![]() |
![]() |
![]() |
#20 | |
Romulan Interpreter
Jun 2011
Thailand
24×571 Posts |
![]() Quote:
![]() But when opened in binary mode, one shows 0x0D, 0x0A at the end of each line, the other only had 0x0A. To my surprise, after a while, they "reverted" (the longer file became shorter), albeit the cards were crunching with the same speed, deleting lines from the files with the same frequency, and I didn't open the files for edit. So, the Owl does indeed make some tricks, when rewriting the files. But I never got an error! (related to this subject). (and I always DO insert the last <enter> by hand when I paste assignments, this habit precedes the Owl, due Mfaktc and cudaLucas also needed <enter> or an empty line before the EOF, sometime in their past) Last fiddled with by LaurV on 2020-10-24 at 10:36 |
|
![]() |
![]() |
![]() |
#21 | |
"Mihai Preda"
Apr 2015
31×43 Posts |
![]() Quote:
If it throws an exception telling you to add a newline, that's fine. OTOH what you seem to have reported earlier was an exponent that was ran twice. That's not consistent with "will stop", and that's what I can't reproduce. In other words: do you see a problem with the current behavior? if so, what is the problem you see, exactly? |
|
![]() |
![]() |
![]() |
#22 | |
"Mihai Preda"
Apr 2015
31×43 Posts |
![]() Quote:
BTW, it is normally accepted that the defition of a line in a file is text that ends with a line separator. This can be seen in the output of "wc -l" which counts the lines in a file, which does not count as a line text that's not line-ended. Anyway putting forward such seemingly obvious solutions as "rewriting the file" and "always add a newline on read" and assuming that I don't implement them due to my simple pleasure in tormenting the user.. yep that's it. |
|
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Errors | kriesel | kriesel | 4 | 2019-05-21 20:51 |
Prime95 errors ( 29.4 v8) under Win 10 x64 | pepi37 | Software | 0 | 2018-11-29 08:17 |
ERRORS | Unregistered | Information & Answers | 2 | 2013-04-01 04:14 |
Prime 95 errors | Wychi | Hardware | 9 | 2004-10-09 16:01 |
heat and errors | crash893 | Hardware | 37 | 2002-11-12 16:33 |