Delphi Io Error 104
Contents |
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 i/o error 104 Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs
Delphi Io Error 103
Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just delphi io error 105 like you, helping each other. Join them; it only takes a minute: Sign up Why is my code causing a I/O 104 error? up vote 1 down vote favorite This program raises an I/O 104 error on
Delphi Io Error 32
EoF when first entering the while loop. The purpose of the program is to look up if a username is already taken. The existing usernames are stored in a text file. procedure TForm1.btnRegisterClick(Sender: TObject); begin sCUser := edtUserName.Text; AssignFile(tNames, 'Names.txt'); begin try Reset(tNames); except ShowMessage('File not found'); Exit; end; end; rewrite(tNames); while not EoF(tNames) do // I get a I/O 104 Error here ` begin Readln(tNames, sLine); iPosComme := Pos(',', sLine); sUser := Copy(sLine, 1, fatal io error 104 iPosComme - 1); Delete(sLine, 1, iPosComme - 1); if sCUser = sUser then begin ShowMessage('Username taken'); end else begin rewrite(tNames); Writeln(tNames, sCUser + ',' + '0'); CloseFile(tNames); end; end; end; delphi delphi-7 share|improve this question edited Oct 14 '13 at 16:21 Jens Mühlenhoff 8,22332372 asked Oct 12 '13 at 14:15 Dévan Steyn 612 You should use TIniFile. –Little Helper Oct 12 '13 at 14:34 1 @Roberts: INI file does not solves the problem at all. –Kromster Oct 12 '13 at 17:34 @Krom Stern I didn't say that it's going to solve the problem =P –Little Helper Oct 12 '13 at 18:04 2 @Roberts: Would be good to hear your reasoning still, why not xml or sql db for example ;-) –Kromster Oct 12 '13 at 18:20 add a comment| 3 Answers 3 active oldest votes up vote 6 down vote Remove the call to Rewrite()before Eof(). Even if you were not getting an IO error, your code would still fail because Rewrite() closes the file you opened with Reset() and then it creates a new bank file, so Eof() would always be True. Update: error 104 is file not open for input, which means Reset() is not opening the file but is not raising an exception (which sounds like an RTL bug if Eof() is ra
has me baffled and I can't find out what a 104 error is in the first place. Here is the source: SetCurrentDirectory(PChar('C:\Batchadd\InPut\Moved')); //switch to input directory FindFirst(PChar('FUSM*.*'),
Xio Fatal Io Error 104
faAnyFile, FindFileData); // find moved files AssignFile(TempFile, FindFileData.Name); // assign as text
Startx Fatal Io Error 104
file Reset(TempFile); //open textfile as read only While NOT EOF(TempFile) Do ----> This is where the crash occurs after having gone through once. Begin Thanks a lot! Hajo http://stackoverflow.com/questions/19335153/why-is-my-code-causing-a-i-o-104-error Markku Nevalaine Delphi Developer Wed, 18 Jun 1902 08:00:00 GMT Re:I/O error 104 while parsing text file Is your I/O error checking turned off? Try turning it on, if it would have any effects. The actual I/O error can be some lines earlier than the de{*word*81} reports it. Markku Nevalainen QuoteJavaHead Jones wrote: > I'm getting a '104' I/O error while parsing a text file. This one has http://www.delphigroups.info/2/43/45318.html me > baffled and I can't find out what a 104 error is in the first place. > Here is the source: > SetCurrentDirectory(PChar('C:\Batchadd\InPut\Moved')); //switch to > input directory > FindFirst(PChar('FUSM*.*'), faAnyFile, FindFileData); // find moved > files > AssignFile(TempFile, FindFileData.Name); // assign as text file > Reset(TempFile); //open textfile as read only > While NOT EOF(TempFile) Do ----> This is where the crash occurs > after having gone through once. > Begin > Thanks a lot! > Hajo Ray Crame Delphi Developer Wed, 18 Jun 1902 08:00:00 GMT Re:I/O error 104 while parsing text file QuoteJavaHead Jones wrote: > I'm getting a '104' I/O error while parsing a text file. This one has me > baffled and I can't find out what a 104 error is in the first place. File not open for input. Quote> Here is the source: > SetCurrentDirectory(PChar('C:\Batchadd\InPut\Moved')); //switch to > input directory > FindFirst(PChar('FUSM*.*'), faAnyFile, FindFileData); // find moved > files > AssignFile(TempFile, FindFileData.Name); // assign as text file > Reset(TempFile); //open textfile a
is answered. Helpful answers available: 2. Correct answers available: 1. Reply to this Thread Search Forum Back to Thread List Replies: 6 - Last Post: May 27, 2014 6:50 PM Last Post By: Van Swofford Chris LeFebvre Posts: 35 Registered: 10/24/99 Understanding I/O error 104? Reply Posted: May 27, 2014 6:22 AM I understand I/O https://newsgroups.embarcadero.com/message.jspa?messageID=655518 104 in general terms, the definition of it is "104 File not open for input Reported by Read, Readln, Eof, Eoln, SeekEof, or SeekEoln on a text file if the file is not open for input" but I'm getting this error in an unusual circumstance and I just can't figure out why this error is being thrown. I have a web page saved as a text file (I need to extract some information from it) and I have a number of other saved web pages as text files that I can io error open just fine, I use an TOpenDialog to locate and specify the file, in my code I have a a variable defined as a TextFile and in tracing through my code the error 104 is being thrown on the assign statement i.e. "Assign( I, OpenDialog1.FileName );". I just don't understand why the Assign statement is throwing a 104 error; the file exists; the code works fine for any number of other similarly saved pages; I can open and edit the file fine in NotePad++; I've copied the text of the delphi io error file inside NotePad++ and created a blank document and then pasted the text into the blank document and then "Saved As" a new different file name and I continue to get the 104 error on Assign on the new file. I've gone so far as to run a checkdsk on the volume where the file resides and run a virus scan (rebooted multiple times) and I still get this 104 error. This just seems odd to me in that the 104 error is not being reported by Read, Readln, Eof, Eoln, SeekEof, or SeekEoln but by Assign and it's not as if the file doesn't exist and I've also copied it to other locations and still get the104 error; the file attribute is just a standard 'a' (archive). At the moment I'm using XE2 for this project. Has anyone seen something like this and have an idea what could be causing this? - Chris Peter Below Posts: 881 Registered: 12/16/99 Re: Understanding I/O error 104? Reply Posted: May 27, 2014 9:39 AM in response to: Chris LeFebvre Chris LeFebvre wrote: I understand I/O 104 in general terms, the definition of it is "104 File not open for input Reported by Read, Readln, Eof, Eoln, SeekEof, or SeekEoln on a text file if the file is not open for input" but I'm getting this error in an unusual circumstance and I just can't figure out why this error is being thrown. I have a web page saved as a text file (I need to extract some information from it) and I have a number of other sa