Solved

I/O Error 183

Posted on 1998-04-02
3
4,516 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
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
williams2 earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now