contents of file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

contents of file

Tudor Girba-3
Hi,

I want to obtain the contents of a file. I am doing the followings:
(FileStream readOnlyFileFullyNamed: fullPath) contentsOfEntireFile

However, what I get is a string with tabs instead of new lines. I am  
on a Mac, and the file I am using is UTF8 using LF. Can anyone tell me  
what I am doing wrong?

Cheers,
Doru

--
www.tudorgirba.com

"Not knowing how to do something is not an argument for how it cannot  
be done."


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: contents of file

Tudor Girba-3
Lukas pointed me to CrLfFileStream which seems to do the job:
(CrLfFileStream readOnlyFileNamed: fullPath) contentsOfEntireFile

Also, it looks like readOnlyFileFullyNamed: is an extension and that I  
should use readOnlyFileNamed:

Please tell me if I am missing something else.

Cheers,
Doru


On 16 Sep 2009, at 22:33, Tudor Girba wrote:

> Hi,
>
> I want to obtain the contents of a file. I am doing the followings:
> (FileStream readOnlyFileFullyNamed: fullPath) contentsOfEntireFile
>
> However, what I get is a string with tabs instead of new lines. I am
> on a Mac, and the file I am using is UTF8 using LF. Can anyone tell me
> what I am doing wrong?
>
> Cheers,
> Doru
>
> --
> www.tudorgirba.com
>
> "Not knowing how to do something is not an argument for how it cannot
> be done."
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
www.tudorgirba.com

"Reasonable is what we are accustomed with."


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project