Print

Print


Dear All,


I am using macOS High Sierra 10.13.6 . I have downloaded the oxmetrics software. I can upload  data but I can't seem to run any of the modules. 


I asked Timberlake , they where not helpful. 


It would be great if anybody would tell me how to install oxmetrics in High Sierra. 


Best wishes,

Rosen


Dr. Rosen Chowdhury

Assistant Professor,

Swansea University 




From: The ox-users list is aimed at all Ox users <[log in to unmask]> on behalf of Jurgen Doornik <[log in to unmask]>
Sent: 01 September 2016 10:23
To: [log in to unmask]
Subject: Re: file close behaviour
 
Hi Chris,

This is a consequence of the fact that arguments are passed by value, not
reference. So fclose cannot modify the variables f0 and f1, just the versions it
receives on the stack.

I expect that what happens when writing using a closed file desciptor is
C-library specific.

If you think this may be a problem, then the work around is to write
        fclose(f0); f0 = 0;
or, using the fact that Ox fclose returns 0:
        f0 = fclose(f0);

A extension to Ox would be to allow fclose(&f0), which would be short-hand for
the above. This would not work in the following sketched example though:

        MyNicePrinting(fo)
        {
                fprint ...
                // all done:
                fo = fclose(fo);
        }
        decl fo = fopen(...);
        MyNicePrinting(fo);

I would not write code like that, because I prefer to match fopen and fclose
more clearly in the code.

The only other way that I can see is to change the Ox file value into an index
into an internally tracked array. This would be quite a substantial change.

Best wishes, Jurgen


oxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxox
oxoxoxox 18th OxMetrics user conference 2016
oxoxoxox      Cass Business School, 12-13 Sept
oxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxox
Dr Jurgen A Doornik
James Martin Fellow, Institute for New Economic Thinking
at the Oxford Martin School, University of Oxford
http://www.doornik.com


http://www.oxmetrics.net
oxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxox

On 2016-08-08 16:22, Chris Ferrall wrote:
> I've encountered a bug that the simple program below partly illustrates.
>
> After fclose(f) I would expect fprintln(f,...) to produce an error.  It does not, because f is still considered a file after close.  The program runs but nothing is sent to file1.txt.  To produce an error you also have to do something like "f = 0;" after the fclose() so that f is no longer of type file.
>
> The real error in my real program that I can't duplicate with a simple program yet is that the text sent to f1 actually appears in another open file, like f0!   The real code that produces this effect involves sending a file as an argument to a function and other stuff that will take a while to strip down.
>
> I will work around the issue, but maybe this is enough for Jurgen to track down the issue.
>
> ----------------------------
>
> #include "oxstd.h"
> static decl f0, f1;
> main() {
>  f0 = fopen("file0.txt","w");
>  f1 = fopen("file1.txt","w");
>  fprintln(f0,"Send something to f0");
>  fclose(f1);
>  fprintln(f1,"Should produce error, but does not.  And under some conditions appears in file0.txt");
>  fclose(f0);
> }
>


To unsubscribe from the OX-USERS list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=OX-USERS&A=1