On Tue, 24 Jul 2007, Tony Maro wrote:

> I'm updating CBT to compile with the latest Lazarus and I'm having
> problems with my file generation routine from inside a component.
> 
> It calls:
> 
> procedure TChkPrinter.PrintChecks;
> var
>     MyFile: TextFile;
>     FileName: String;
>     // extraneous info removed
> begin
>     // more extraneous info removed
>     Filename := '/tmp/cbtrack.ps';
>     AssignFile(MyFile, FileName);
>     rewrite(MyFile);        
>     writeln(MyFile, '%!PS-Adobe-3.0');
>     writeln(MyFile, '%%Creator: CBT');
>     writeln(MyFile, '%%Title: Checks');
>     writeln(MyFile, '%%Pages: (atend)');
>     writeln(MyFile, '%%PageOrder: Ascend');
>     writeln(MyFile, '/AvantGarde-Book findfont');  
> 
>     // more extraneous info removed
>     closefile(MyFile);
> end;
> 
> The problem is there is no error, and it does NOT create the file.  I've
> tried various paths, I've pasted this code into a new form and it works
> fine.
> 
> How can I figure out what's (not) going on if there's no error
> generated?

Try a strace of your program:
strace -o log.txt ./myprogram

After execution, you can open the log.txt file, and you should see somewhere
a line:
open("/tmp/cbtrack.ps",SOME OPTIONS) = 
(grep for the filename) if this line is not present, then the rewrite call was 
not
executed. If the line is present, then the return value should give you an
idea of the error.

Michael.

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to