Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

EInOutError with the message 'I/O error 103

1,150 views
Skip to first unread message

BrazilSmart

unread,
May 7, 2003, 8:42:26 AM5/7/03
to
Hi, I惴 new to this group and to delphi.
It愀 a pleasure to be with you wise guys.

I惴 having problems with the following code.

var

f: TextFile;
begin
if OpenDialog1.Execute then
begin { open a text file }
AssignFile(f, OpenDialog1.FileName);
>> Append(f);
Writeln(f, 'I am appending some stuff to the end of the file.');
{ insert code here that would require a Flush before closing the file }
Flush(f); { ensures that the text was actually written to file }
CloseFile(f);
end;

end;

It stops on the signed line (>>) and returns a exception :EInOutError with
the message 'I/O error 103

The file exists on the disk it was created with

FileCreate(PathLoc + '\log.txt'); statement.

What愀 wrong?

Thanks in Advance

Augusto From Brazil

Robert Kaplan

unread,
May 7, 2003, 9:05:18 AM5/7/03
to

"BrazilSmart" <aug...@maxximus.com.br> wrote in message
news:3eb8fee1$1...@newsgroups.borland.com...

>
> FileCreate(PathLoc + '\log.txt'); statement.
>

This is probably your problem. Try the following

var I : integer;
I := FileCreate(PathLoc + '\log.txt');
FileClose(I);

Robert

Kurt Barthelmess (TeamB)

unread,
May 7, 2003, 9:39:34 AM5/7/03
to
"BrazilSmart" <aug...@maxximus.com.br> wrote:

> AssignFile(f, OpenDialog1.FileName);
>>> Append(f);

>It stops on the signed line (>>) and returns a exception :EInOutError with
>the message 'I/O error 103
>
>The file exists on the disk it was created with
>
>FileCreate(PathLoc + '\log.txt'); statement.

In addition to not having called FileClose, some other process may
have the file open exclusively.

Good luck.

Kurt


Iain Macmillan

unread,
May 7, 2003, 10:17:46 AM5/7/03
to

In article <3eb90c55...@newsgroups.borland.com>,
kbarth...@compuserve.com (Kurt Barthelmess (TeamB)) wrote:

> In addition to not having called FileClose, some other process may
> have the file open exclusively.

You might be right, Kurt, as to the actual problem, (file creation has left
it open or something else holds it open) - but it needs assumptions that
there are typos in the post! - I'd expect 105 (access denied) then, not 103,
which is 'file not open' - 103 should not occur on an append .. (unless it
is a namespace problem and append does not do what we expect!) .. though it
might occur on the writeln .. (how could it reach that though, if the file
wasn't opened an exception should fire as there is no defence) .... enough,
lets see if he comes back!

Kurt Barthelmess (TeamB)

unread,
May 7, 2003, 11:38:45 AM5/7/03
to
"Iain Macmillan" <he...@ariesps.co.uk> wrote:

>You might be right, Kurt, as to the actual problem, (file creation has left
>it open or something else holds it open) - but it needs assumptions that
>there are typos in the post! - I'd expect 105 (access denied) then, not 103,
>which is 'file not open' - 103 should not occur on an append .. (unless it
>is a namespace problem and append does not do what we expect!) .. though it
>might occur on the writeln .. (how could it reach that though, if the file
>wasn't opened an exception should fire as there is no defence) .... enough,
>lets see if he comes back!

Yes, or I/O error 32. 103 (in my help system) says "File not open" -
but that should happen on the write, not the Append.

But this could be a file on the network which can give strange errors,
so...

Kurt


0 new messages