www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - A new article about working with files in D

reply Gary Willoughby <dev nomad.so> writes:
Article:
http://nomad.so/2015/09/working-with-files-in-the-d-programming-language/

Reddit link:
https://www.reddit.com/r/programming/comments/3mosw7/working_with_files_in_the_d_programming_language/
Sep 28 2015
next sibling parent reply ponce <contact gam3sfrommars.fr> writes:
On Monday, 28 September 2015 at 11:41:37 UTC, Gary Willoughby 
wrote:
 Article:
 http://nomad.so/2015/09/working-with-files-in-the-d-programming-language/

 Reddit link:
 https://www.reddit.com/r/programming/comments/3mosw7/working_with_files_in_the_d_programming_language/
Great article, I can see this become a reference link whenever one need a quick answer about files. I also like how readable your blog is.
Sep 28 2015
parent Kagamin <spam here.lot> writes:
On Monday, 28 September 2015 at 12:19:21 UTC, ponce wrote:
 I also like how readable your blog is.
Mm? http://abload.de/img/tmpviqau.png
Oct 01 2015
prev sibling next sibling parent reply bachmeier <no spam.com> writes:
On Monday, 28 September 2015 at 11:41:37 UTC, Gary Willoughby 
wrote:
 Article:
 http://nomad.so/2015/09/working-with-files-in-the-d-programming-language/

 Reddit link:
 https://www.reddit.com/r/programming/comments/3mosw7/working_with_files_in_the_d_programming_language/
This is the best way to market the language, by making it easy to do practical things. Good work.
Sep 28 2015
parent reply Gary Willoughby <dev nomad.so> writes:
On Monday, 28 September 2015 at 14:05:42 UTC, bachmeier wrote:
 This is the best way to market the language, by making it easy 
 to do practical things. Good work.
This is my thoughts exactly and why I wrote this article. Why I read the Go article which inspired this one I was shocked by how awful it was compared to working with files in D. Yes, Go has a few more functions available but all are a bit clunky to work with. D on the other hand is always simple and elegant.
Sep 28 2015
parent karabuta <karabutaworld gmail.com> writes:
On Monday, 28 September 2015 at 17:15:38 UTC, Gary Willoughby 
wrote:
 On Monday, 28 September 2015 at 14:05:42 UTC, bachmeier wrote:
 This is the best way to market the language, by making it easy 
 to do practical things. Good work.
This is my thoughts exactly and why I wrote this article. Why I read the Go article which inspired this one I was shocked by how awful it was compared to working with files in D. Yes, Go has a few more functions available but all are a bit clunky to work with. D on the other hand is always simple and elegant.
Cool! More Articles
Sep 28 2015
prev sibling next sibling parent jmh530 <john.michael.hall gmail.com> writes:
On Monday, 28 September 2015 at 11:41:37 UTC, Gary Willoughby 
wrote:
 Article:
 http://nomad.so/2015/09/working-with-files-in-the-d-programming-language/

 Reddit link:
 https://www.reddit.com/r/programming/comments/3mosw7/working_with_files_in_the_d_programming_language/
Cool.
Sep 28 2015
prev sibling next sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 9/28/2015 4:41 AM, Gary Willoughby wrote:
 Article:
 http://nomad.so/2015/09/working-with-files-in-the-d-programming-language/

 Reddit link:
 https://www.reddit.com/r/programming/comments/3mosw7/working_with_files_in_the_d_programming_language/
Dazz!
Sep 28 2015
prev sibling next sibling parent Jack Stouffer <jack jackstouffer.com> writes:
On Monday, 28 September 2015 at 11:41:37 UTC, Gary Willoughby 
wrote:
 Article:
 http://nomad.so/2015/09/working-with-files-in-the-d-programming-language/

 Reddit link:
 https://www.reddit.com/r/programming/comments/3mosw7/working_with_files_in_the_d_programming_language/
BTW, I thought of something for your hidden treasure series, something that's actually hidden: std.internal.test.dummyrange It's great for easily testing range based code with many different types of ranges.
Sep 28 2015
prev sibling next sibling parent reply Suliman <evermind live.ru> writes:
Big thanks! It's very helpful for newcomers. D need extend Phobos 
docs with such examples. Is there any plan to do it, because it's 
often it's hard to understand how to proper use functions.

Also I think you need to add example of getting file list (all 
and with specified extension).

Also some FTP examples maybe very good.
Sep 28 2015
parent reply extrawurst <stephan extrawurst.org> writes:
On Tuesday, 29 September 2015 at 06:26:32 UTC, Suliman wrote:
 Big thanks! It's very helpful for newcomers. D need extend 
 Phobos docs with such examples. Is there any plan to do it, 
 because it's often it's hard to understand how to proper use 
 functions.

 Also I think you need to add example of getting file list (all 
 and with specified extension).

 Also some FTP examples maybe very good.
I agree on that, these examples should be added to the ddocs of phobos. -- Stephan
Sep 30 2015
parent reply Gary Willoughby <dev nomad.so> writes:
On Wednesday, 30 September 2015 at 08:32:29 UTC, extrawurst wrote:
 I agree on that, these examples should be added to the ddocs of 
 phobos.

 -- Stephan
I might do that myself. :)
Sep 30 2015
parent extrawurst <stephan extrawurst.org> writes:
On Wednesday, 30 September 2015 at 17:03:25 UTC, Gary Willoughby 
wrote:
 On Wednesday, 30 September 2015 at 08:32:29 UTC, extrawurst 
 wrote:
 I agree on that, these examples should be added to the ddocs 
 of phobos.

 -- Stephan
I might do that myself. :)
As always in dland: you better do it yourself ;) -- Stephan
Sep 30 2015
prev sibling next sibling parent Nikolay <sibnick gmail.com> writes:
On Monday, 28 September 2015 at 11:41:37 UTC, Gary Willoughby 
wrote:
 Article:
 http://nomad.so/2015/09/working-with-files-in-the-d-programming-language/

 Reddit link:
 https://www.reddit.com/r/programming/comments/3mosw7/working_with_files_in_the_d_programming_language/
A little criticism: write(file, read(file, size)); truncate by reading/writing is not good sample at least for official docs. It is not efficient. You can use POSIX truncate or _chsize Windows system calls for truncation to specific length. For zero it is simpler: open("file", "w+"); std.outbuffer; In Java world you can write OutputStream out = new BufferedOutputStream(new FileOutputStream(fileName), BUF_SIZE); It is not clear how to combine OutBuffer and write in such way.
Oct 01 2015
prev sibling parent Andre Polykanine <andre oire.org> writes:
On Monday, 28 September 2015 at 11:41:37 UTC, Gary Willoughby 
wrote:
 Article:
 http://nomad.so/2015/09/working-with-files-in-the-d-programming-language/

 Reddit link:
 https://www.reddit.com/r/programming/comments/3mosw7/working_with_files_in_the_d_programming_language/
I have translated this article into Russian: http://habrahabr.ru/post/270189/
Nov 05 2015