Message5687

Author jfenwick
Recipients amak, jfenwick, leosoto, pjenvey
Date 2010-04-12.22:51:28
SpamBayes Score 6.6080252e-09
Marked as misclassified No
Message-id <1271112689.02.0.386463376479.issue1549@psf.upfronthosting.co.za>
In-reply-to
Content
Alan, I think what Philip wants is a simpler wrapper function that moves the name of the object into the PyFile object. The name is what is printed out in Java when you pass the object to System.out.println.

Here is a possible fix:

FileUtil.java:
    public static PyFile wrap(InputStream is, String mode, int bufsize) {
        return new PyFile(is, mode, bufsize);    
    }

This would have a corresponding PyFile entry, which would call the PyFile entry from the patch:

PyFile.java:
    public PyFile(InputStream istream, String mode, int bufsize) {
        PyFile(istream, "<Java InputStream '" + istream + "' as file>", mode, bufsize, true)
    }


Note 1: I took the liberty of adding bufsize to the wrapper function, as most of the other wrapper functions in FileUtil have bufsize, so I assume it's something people want often.

Note 2: I didn't compile or try this, so please don't just check it in, try it.
History
Date User Action Args
2010-04-12 22:51:29jfenwicksetmessageid: <1271112689.02.0.386463376479.issue1549@psf.upfronthosting.co.za>
2010-04-12 22:51:29jfenwicksetrecipients: + jfenwick, amak, leosoto, pjenvey
2010-04-12 22:51:28jfenwicklinkissue1549 messages
2010-04-12 22:51:28jfenwickcreate