I/o Error 988 Delphi
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up block read error up vote -1 down vote favorite Can anybody please explain me why I am hitting 'I/O error 998' in the below block read? function ReadBiggerFile: string; var biggerfile: file of char; BufArray: array [1 .. 4096] of char; // we will read 4 KB at a time nrcit, i: integer; sir, path: string; begin path := ExtractFilePath(application.exename); assignfile(biggerfile, path + 'asd.txt'); reset(biggerfile); repeat blockread(biggerfile, BufArray, SizeOf(BufArray), nrcit); for i := 1 to nrcit do begin sir := sir + BufArray[i]; Form4.Memo1.Lines.Add(sir); end; until (nrcit = 0); closefile(biggerfile); ReadBiggerFile := sir; end; delphi delphi-unicode share|improve this question edited Feb 29 '12 at 8:22 Cosmin Prund 22.5k23987 asked Feb 29 '12 at 4:16 jimsweb 5291627 1 I mis-read the code when I answered ... it was incorrect, so I deleted it. I'm unsure what is causing the error. Sorry about that. –Mark Wilkins Feb 29 '12 at 4:31 1 Why you not just use Form4.Memo1.Lines.LoadFromfile() or TStringList.LoadFromfile? Anyway try declaring the biggerfile as file instead of file of char and replace reset(biggerfile) for reset(biggerfile,1) –RRUZ Feb 29 '12 at 4:39 1 Even if the memo is not part of the code you can use the TStringList.LoadFromFile() method or try using the suggestions of my above comment. –RRUZ Feb 29 '12 at 4:44 2 @jimsweb: The message text of I/O error 998 is Invalid access to memory location (c.f. Windows.pas). Btw, You can elaborate, post an answer to your own question (after all it's been resolved) and accept it. –menjaraz Feb 29 '12 at 5:39 2 This is the most diabolical way to load a file. Building strings character by character. A better question would be to ask how to load a
state. (If the application does not include the System.SysUtils unit, the exception causes the application to terminate). Handling I/O Errors In the {$I-} state, the program continues to execute, and the error is reported by the IOResult function. I/O Error List The following table lists all I/O errors, numbers, and descriptions. Number Name Description 100 Disk read error Reported by Read on a typed file if you attempt to read past the end of the file. 101 Disk write error Reported by CloseFile, Write, WriteIn, or Flush if the disk becomes full. 102 File not assigned Reported by Reset, http://stackoverflow.com/questions/9493522/block-read-error Rewrite, Append, Rename, or Erase if the file variable has not been assigned a name through a call to Assign or AssignFile. 103 File not open Reported by CloseFile, Read Write, Seek, Eof, FilePos, FileSize, Flush, BlockRead, or BlockWrite if the file is not open. 104 File not open for input Reported by Read, Readln, Eof, Eoln, SeekEof, or SeekEoln on a text file if the file is http://docwiki.embarcadero.com/RADStudio/Seattle/en/Input-Output_Errors not open for input. 105 File not open for output Reported by Write or Writeln on a text file if you do not generate a Console application. 106 Invalid numeric format Reported by Read or Readln if a numeric value read from a text file does not conform to the proper numeric format. See Also Exception Handling Resolving Internal Errors (Delphi) Delphi Runtime Errors Fatal errors Operating system errors Retrieved from "http://docwiki.embarcadero.com/RADStudio/Seattle/e/index.php?title=Input-Output_Errors&oldid=227166" Category: RAD Studio ReferenceHidden category: AMMigrate Views Page Discussion View source History Personal tools Create account Log in Search RAD Studio Seattle Seattle Examples and Samples Seattle Libraries Main Page - Seattle Topics Wiki What's New Tutorials FireMonkey Application Platform Multi-Device Applications Getting Started Steps in Developing a Project Key Application Types FireDAC Windows Developer's Guide Modeling Tools IDE Reference and Utilities Delphi Reference C++ Reference Subject Index HTML5 Builder Newer Versions Berlin Topics Previous Versions XE8 Topics XE7 Topics XE6 Topics XE5 Topics XE4 Topics XE3 Topics XE2 Topics XE Topics 2010 Topics In other languages Deutsch Français 日本語 Assistance Known Problems and Recent Fixes Random Page Recent changes Help Tools What links here Related changes Special pages Printable version Permanent link Page information This page was last modifi
itSDS Member From: Germany Registered: 2014-04-24 Posts: 304 Multithreading Problem Hi AB we encounter exception in SynDB in http://synopse.info/forum/viewtopic.php?pid=18655 our MVC - Service.The first Problem is that we cannot reproduce it easily.I'll explain what happens.a View with 4 edit controls is displayed in the browser. There a button "Check and Save" is displayed.Now the user press this button multiple times (doppelclick, trippleclick, ...)In the service the same viewfunction is called as often as i/o error it is clicked after each other. This is handled in a number of Threads.In this viewfunction a lot of "RestModel" Queries are called. Cause of the multi click they are called parallel in several Threads.(as in your mvcserver but lets say 10 to 100 queries in a row)Normaly if you only click this button once, i/o error 988 a Result Page should be shown.Now we encounter a lot exception:Erste Gelegenheit für Exception bei $77873E28. Exception-Klasse EFDException mit Meldung '[FireDAC][Phys][MySQL]-326. Ausführen der Aktion nicht möglich, weil die vorherige Aktion noch nicht abgeschlossen ist'. Prozess Service.exe (4896) Erste Gelegenheit für Exception bei $008EC1E7. Exception-Klasse $C0000005 mit Meldung 'access violation at 0x008ec1e7: write of address 0x00640092'. Prozess Service.exe (4896) Erste Gelegenheit für Exception bei $77873E28. Exception-Klasse EHttpApiServer mit Meldung 'HttpSendHttpResponse failed: Der angegebene Netzwerkname ist nicht mehr verfügbar (64)'. Prozess Service.exe (4896) Erste Gelegenheit für Exception bei $77873E28. Exception-Klasse EAccessViolation mit Meldung 'Zugriffsverletzung bei Adresse 008EC1E7 in Modul 'Service.exe'. Schreiben von Adresse 00640092'. Prozess Service.exe (4896) Erste Gelegenheit für Exception bei $77873E28. Exception-Klasse EAccessViolation mit Meldung 'Zugriffsverletzung bei Adresse 008EC1E7 in Modul 'Service.exe'. Schreiben von Adresse 00640092'. Prozess Service.exe (4896) Erste Gelegenheit für Exception bei $77873E28. Exception-Klasse EHttpApiServer mit Meldung 'HttpSendHttpResponse failed: Der angegebene Netzwerkname ist nicht mehr verfügbar (64)'. Prozess Service.exe (4896) Erste Gelegenheit für Exception bei $77873E28. Exception-Klasse EAccessViolation mit