How to force UNIX text files as output instead of DOS text files??
I am working on a small program which writes a text file but I need this file to be in UNIX format and as it is a Windows program I am compiling it, the output file tends to be in DSO format. Is there anyway that I can force it to create the file in UNIX format??? Best Regards NooK
On Mon, 3 Mar 2003 00:35:47 +0100 "Alexandre Weffort Thenorio" <alethenorio@home.se> wrote:
the output file tends to be in DSO format. Is there anyway that I can force it to create the file in UNIX format???
I am not an expert on the subject, but ... maybe you just have to use a string constant named "newline" (maybe a function with an implicit argument of type (Dos|Unix)) instead of "\n". Vincenzo
Alexandre Weffort Thenorio wrote:
I am working on a small program which writes a text file but I need this file to be in UNIX format and as it is a Windows program I am compiling it, the output file tends to be in DSO format. Is there anyway that I can force it to create the file in UNIX format???
Use openFileEx, e.g.: import IOExts ... handle <- openFileEx filename (BinaryMode WriteMode) -- Glynn Clements <glynn.clements@virgin.net>
Thanks a lot m8 but ghc says it can't the module IOExts when I try to compile, any suggestion??? Do I just use normal writeFile method to create the text file then?? Best Regards Alex ----- Original Message ----- From: "Glynn Clements" <glynn.clements@virgin.net> To: "Alexandre Weffort Thenorio" <alethenorio@home.se> Cc: <Haskell@haskell.org> Sent: Monday, March 03, 2003 2:02 AM Subject: Re: How to force UNIX text files as output instead of DOS text files??
Alexandre Weffort Thenorio wrote:
I am working on a small program which writes a text file but I need this file to be in UNIX format and as it is a Windows program I am compiling it, the output file tends to be in DSO format. Is there anyway that I can force it to create the file in UNIX format???
Use openFileEx, e.g.:
import IOExts ... handle <- openFileEx filename (BinaryMode WriteMode)
-- Glynn Clements <glynn.clements@virgin.net> _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
OK I fixed the IOExts not found problem (-package lang) but my problem now is that I never worked with handles. How can I write the string to the file and so on?? Where can I find more info on handle data types?? Best Regards NooK ----- Original Message ----- From: "Glynn Clements" <glynn.clements@virgin.net> To: "Alexandre Weffort Thenorio" <alethenorio@home.se> Cc: <Haskell@haskell.org> Sent: Monday, March 03, 2003 2:02 AM Subject: Re: How to force UNIX text files as output instead of DOS text files??
Alexandre Weffort Thenorio wrote:
I am working on a small program which writes a text file but I need this file to be in UNIX format and as it is a Windows program I am compiling it, the output file tends to be in DSO format. Is there anyway that I can force it to create the file in UNIX format???
Use openFileEx, e.g.:
import IOExts ... handle <- openFileEx filename (BinaryMode WriteMode)
-- Glynn Clements <glynn.clements@virgin.net> _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
On Mon, 3 Mar 2003 11:03:48 +0100 "Alexandre Weffort Thenorio" <alethenorio@home.se> wrote:
OK I fixed the IOExts not found problem (-package lang) but my problem now is that I never worked with handles. How can I write the string to the file and so on?? Where can I find more info on handle data types??
In the "IO" section of the prelude, http://www.zvon.org/other/haskell/Outputio/index.html Vincenzo
Hi Great I got it working. Thanks a lot guys. My only problem now is when compiling. I am getting: hextodat.0(.text+0x34):fake: undefined reference to '_stginit_IOExts' Anybody can tell me what could be wrong?? I can run --make but when trying to compile with -o flag I get this error. Best Regards Alex ----- Original Message ----- From: "Nick Name" <nick.name@inwind.it> To: <haskell@haskell.org> Sent: Monday, March 03, 2003 1:34 PM Subject: Re: How to force UNIX text files as output instead of DOS text files??
On Mon, 3 Mar 2003 11:03:48 +0100 "Alexandre Weffort Thenorio" <alethenorio@home.se> wrote:
OK I fixed the IOExts not found problem (-package lang) but my problem now is that I never worked with handles. How can I write the string to the file and so on?? Where can I find more info on handle data types??
In the "IO" section of the prelude,
http://www.zvon.org/other/haskell/Outputio/index.html
Vincenzo _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
participants (3)
-
Alexandre Weffort Thenorio -
Glynn Clements -
Nick Name