Solved

I/O Error 183

Posted on 1998-04-02
3
4,709 Views
Last Modified: 2011-10-03
just started geting i/o error 183 to a program that has been working for years!. Using delphi 2.0 and DBF files; trying to perform a rewrite following and AssignFile to a textfile var on a unique filename. The file name has a full path defined to a directory that does exists on a drive that does exist. This occurs on the local drive (non-networked) on either a windows nt client or a windows 95 client. I can't find any docs on this......
0
Comment
Question by:asleszynski
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
williams2 earned 100 total points
ID: 1361252
I have experienced your problem before. I solved it by setting the generel FileMode variable like this:

Procedure WriteFile(FileName: String);
var
  F: File of text;
Begin
  AssignFile(F,FileName);

//Valid FileMode values are:
//0      Read only
//1      Write only
//2      Read/Write

  FileMode:= 2;
  Reset(F);
  Write(F,'Hello World');
  CloseFile(F);
End;

The big problem is, that Delphi got severel levels of filehandling, and mixing them, can make influence to previous written and (almost) perfect working code. :-)

Regards
Williams
0
 

Author Comment

by:asleszynski
ID: 1361253
i/o error 183 really is "Directory already exists". Prior in my code I issued a {$I-} followed by a series of MkDir commands containing paths that Already exist. Since I forgot to perform IOResult following the MKDir, the error propageted into the next i/o call; or ReWrite. I/O Error 183 was actually occuring on the MkDir function call. A call to IOResult would have cleared it.....thanks to all.... alan
0
 
LVL 3

Expert Comment

by:williams2
ID: 1361254
You paid a big for that one then, hope you can make use of my hints then selsewhere.

I didn't know that Error, I haven't had the problem before, but instead of using the {$I-} directive,  use the Try-Except block instead. You may be able to write more user.friendly code then.

Regards
Williams
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question