Delphi and Kylix

Moderators: pritaeas
Number of threads: 7244
Number of posts: 19051

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
BlockWrite failed!!!!? Posted by krutikansara on 20 Jul 2009 at 4:30 AM
Hi All,

In my application, I am using 'BlockWrite' procedure to write my structured data into file. It was working fine.

But since last 2-3 days, I am getting error in BlockWrite procedure.
Actually, there are so many forms and units in my application; and i tried BlockWrite from different forms too, but in vain. I am stuck with the error and can not understand how it sudden refused to work!!!

I tried the same function with another testing application and it is working fine there; which is more confusing.

This is the testing function which I tried in both, my main application and my testing application.

procedure _SaveDataToFile();
var
    Buf: Array[0..255] of char;
    TestFile: File of Char;
begin
        AssignFile(TestFile, 'c:\abcd.cfg');
        ReSet(TestFile);
        if not EOF(TestFile) then
            Seek(TestFile, FileSize(TestFile));
        Buf := 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk';
        BlockWrite(TestFile, Buf, sizeof(Buf));
	CloseFile(TestFile);
end;


Can any one help me?

Thanks in advance.
Report
Re: BlockWrite failed!!!!? Posted by Kyl3 on 26 Aug 2009 at 6:09 PM
I swear the exact same thing happened to me.
I have a download program that uses block write and now I get a I/O Error and when I try to recompile it mess up at the block write part.

Using Delphi 7



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.