On 04/03/2013 01:47 AM, Brian Anderson wrote:
On 04/01/2013 11:16 AM, Pierre Louis Aublin wrote:
Hello everybody

I heard about Rust a few weeks ago and am very excited by this new language. To get a grip I have created a simple web server, with the v0.5 of the language: https://github.com/schaars/simple-web-server It is quite limited, as it handles only 1 client at a time and HTTP 1.0 GET request, but it was interesting to write. Feel free to make any comment :)

I have a few questions about the language. I hope this mailing list is the right place to ask. 1) When I read a file, how can I make the difference between "file not found" and "not authorized to open file"? In my web server I cannot make it because in both cases the Result returned by io::read_whole_file() is Err(~"error opening file").

It's not possible at the moment. The I/O library just needs to be improved here.


2) I have not found how to use a single channel (pipes::stream) between 1 sender and n receivers. Is it possible? The solution I found (but not implemented because I had a vector size problem (https://github.com/mozilla/rust/pull/5112)), is to create several channels and write to them in a round-robin manner, but it's not ideal.


Again, there is no abstraction for this in the libraries yet.
Thanks for your reply. I will continue to learn Rust in order to contribute soon.

4) I have found a prototype error in http://static.rust-lang.org/doc/core/files/str-rs.html#bytes : the name of the function is to_bytes() instead of bytes(). By the way, this page is very useful but hard to find: I have not found any link from www.rust-lang.org

Wow! I'm not sure how you found that file, but it is a remnant of the pre-0.1 Rust documentation. It should not exist on the server.
:) I found it via google. It's the first result when I search for "rust convert str to bytes" (without quotes).



Best regards
Pierre Louis Aublin
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev


_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to