New sys.io package

91 views
Skip to first unread message

Nicolas Cannasse

unread,
Dec 2, 2011, 5:22:59 PM12/2/11
to haxe...@googlegroups.com
Hi,

I will soon add the new sys.io package, which will be including
[neko|cpp|php].io packages :

*.io.File
*.io.FileInput
*.io.FileOutput
*.io.Process
*.FileSystem (will become sys.io.FileSystem)

As well as neko.Sys (and php.Sys and cpp.Sys) which will become sys.Lib.

Any change that you would like to see in the new API ?

Best,
Nicolas

Joshua Granick

unread,
Dec 2, 2011, 5:40:49 PM12/2/11
to haxe...@googlegroups.com
It would be great to be able to simulate a file input or output using
bytes.

I found myself trying to unzip (or untar?) files in memory, when it
wouldn't work unless I wrote it to the filesystem first.

It would also be great if we could add some little things like chmod to
the official API


--
Using Opera's revolutionary email client: http://www.opera.com/mail/

Nicolas Cannasse

unread,
Dec 2, 2011, 5:49:29 PM12/2/11
to haxe...@googlegroups.com
Le 02/12/2011 23:40, Joshua Granick a ᅵcrit :

> It would be great to be able to simulate a file input or output using
> bytes.

You can do that already by using haxe.io.BytesOutput/Input.

> It would also be great if we could add some little things like chmod to
> the official API

Added here http://code.google.com/p/haxe/issues/detail?id=590

Best,
Nicolas

Joshua Granick

unread,
Dec 2, 2011, 6:04:24 PM12/2/11
to haxe...@googlegroups.com
Recursive createDirectory will be nice!

Thank you!

On Fri, 02 Dec 2011 14:49:29 -0800, Nicolas Cannasse
<ncan...@motion-twin.com> wrote:

> Le 02/12/2011 23:40, Joshua Granick a écrit :
>> It would be great to be able to simulate a file input or output using
>> bytes.
>
> You can do that already by using haxe.io.BytesOutput/Input.
>
>> It would also be great if we could add some little things like chmod to
>> the official API
>
> Added here http://code.google.com/p/haxe/issues/detail?id=590
>
> Best,
> Nicolas

Tarwin Stroh-Spijer

unread,
Dec 2, 2011, 6:19:39 PM12/2/11
to haxe...@googlegroups.com
Maybe a recursive removeDirectory as well ?

Also, I'm not sure on the other targets, but in PHP you really need a "a" and "a+" flag as optional. This lets you open a file for writing (or reading / writing) and place the pointer at the END of the file, allowing appends.

Regards,


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________

Benjamin Dasnois

unread,
Dec 2, 2011, 7:27:41 PM12/2/11
to haxe...@googlegroups.com
Hi Nicolas,

Do we agree on the fact that this is for v3? This is important since it is a breaking change. Or maybe are you planning to go through a transition phase during which all packages will coexist?

Regards,
--
DASNOIS Benjamin
http://www.benjamindasnois.com

Nicolas Cannasse

unread,
Dec 3, 2011, 3:33:22 AM12/3/11
to haxe...@googlegroups.com
Le 03/12/2011 01:27, Benjamin Dasnois a �crit :

> Hi Nicolas,
>
> Do we agree on the fact that this is for v3? This is important since it
> is a breaking change. Or maybe are you planning to go through a
> transition phase during which all packages will coexist?

Yes, both will coexist, at least on SVN until 3.0 is released (or 2.09
is we have time for an intermediate release).

Best,
Nicolas

Rob Fell

unread,
Dec 4, 2011, 3:03:17 PM12/4/11
to haxe...@googlegroups.com
Hi, any chance of a "touch" that allows date modified for any file to be specified (across all systems)? 

Oļegs Baļss

unread,
Dec 5, 2011, 3:07:59 AM12/5/11
to haXe
> As well as neko.Sys (and php.Sys and cpp.Sys) which will become sys.Lib.

Good move, bad class name.

import neko.Lib;
import sys.Lib;

I would suggest sys.Sys or sys.Env if nothing better comes up.

Philippe Elsass

unread,
Dec 5, 2011, 3:16:38 AM12/5/11
to haxe...@googlegroups.com
I second Olegs' note: don't use Lib to avoid imports ambiguity.
--
Philippe

Juan Delgado

unread,
Dec 5, 2011, 9:58:43 AM12/5/11
to haxe...@googlegroups.com
Hi Nicolas,

Is the new structure going to swap transparently to the right target?

IE: the current API has cpp.io.*, neko.io.*, etc, are these now going
to be into one single API? io.File + conditional compilation?

Also, it would be really handy if io.FileStat would return whether a
file/folder is hidden. The current implementation on XAPI is based on
the the item name in *nix ("." as the first char) and some very dodgy
call to the attrib command on Windows.

Having something more consistent would be ACE.

Last, would you consider moving anything to do with folders out of the
File class? Basically so you have similar File and Folder objects with
similar methods (read, create, remove)? I wrote about it here:

http://blog.zarate.tv/2010/06/19/a-folder-is-not-a-file/

(Sorry for the lack of formatting, got hacked not long ago!).

Cheers!

J

--
Juan Delgado - Zárate
http://zarate.tv
http://blog.zarate.tv

Reply all
Reply to author
Forward
0 new messages