[IronPython] Creating Python file from .NET stream

Haibo Luo haiboluo at exchange.microsoft.com
Mon Mar 13 19:27:44 CET 2006


We have a bug which allows FileStream only. We will fix it in next release.

As workaround, you can update (in line~746 PythonFile.cs) as follows and rebuild:
        public static PythonFile Make(object cls, FileStream filestream) {
to
        public static PythonFile Make(object cls, Stream filestream) {

Thanks!

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland
Sent: Monday, March 13, 2006 9:03 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Creating Python file from .NET stream

You should be able to do:

>>> import System
>>> a = System.IO.FileStream('abc', System.IO.FileMode.Create)
>>> file(a)
<file 'F:\Product\IronPython\IronPython\abc', w+>

That should work w/ a network stream as well, but the filename will show up as "nul" in that case.


Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)
-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo
Sent: Sunday, March 12, 2006 11:30 PM
To: Discussion of IronPython
Subject: [IronPython] Creating Python file from .NET stream

Beta 4 changelogs have:

"Support for constructing Python file from .NET Stream"

But I still can't figure out how to do this. Any example will be greatly appreciated.

For example, how do I create Python file from NetworkStream?

Seo Sanghyeon
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list