?
Solved

I/O Error 183

Posted on 1998-04-02
3
Medium Priority
?
4,764 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 200 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

Industry Leaders: 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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

762 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