File registering bug 2: NewReader issue

From: Wijck, Bart van <"Wijck,>
Date: Mon, 26 Jan 2004 14:39:27 +0100

----boundary-LibPST-iamunique-657005413_-_-
Content-type: text/plain

Hi,

Continuing on from the previous problem, I get another error.

This time I am registering the file in the DbuClient.GetFile procedure.

Next I try to do the following (as before).

        IF f = NIL THEN
                Log.String("Test Failed"); Log.Ln;
        ELSE
                Log.String("Test Succeeded"); Log.Ln;
                r := f.NewReader(NIL);
                WHILE ~r.eof DO
                        r.ReadByte(b); ch := CHR(b);
                        (* further processing here *)
                END;
                f.Close;
        END;

This time it aborts with a TRAP 20 (Precondition violated) on the NewReader
statement. In the documentation there's no precondition with number 20 in
the Files.NewReader procedurer description. Elsewhere in the Files module
documentation it seems to indicate that the file is still anonomous (which
seems strange as it is registered).

I can circumvent it by formally reopening the file with:
        Loc := Files.dir.This(path); (* locator object *)
        f := Files.dir.Old(Loc,file,FALSE);

and then do the NewReader etc.

That seems somewhat superfluous as I already had a f pointer value. So why
can't I directly connect a NewReader to it?

Any answers?

Bart



-- 
The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it. 
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xyTo get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xyCurrent posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-657005413_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbX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