Re: Files and Buffers

2018-02-02 Thread Jerry Ferris via Digitalmars-d-learn
Good day, I reexamined my objective and needs, and I've determined that the entirety of the input does not need to be read in all cases. Thus I've returned to using File instead std.file.read. I should've put forth more thought; because I did not, I created a fairly useless OP. I do

Re: Files and Buffers

2018-02-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, February 02, 2018 09:40:52 Steven Schveighoffer via Digitalmars- d-learn wrote: > std.file.read returns a void[]. > > I didn't see one that returns a ubyte[], and using the readText version > is going to validate the text I think (which may not be desired). It > really depends on the

Re: Files and Buffers

2018-02-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/1/18 8:27 PM, Seb wrote: On Thursday, 1 February 2018 at 21:42:33 UTC, Steven Schveighoffer wrote: On 2/1/18 4:36 PM, Jerry Ferris wrote: Hello, I'm developing a program that will either receive data from stdin or a file, and pass it along to a function for processing. I want to place

Re: Files and Buffers

2018-02-01 Thread Seb via Digitalmars-d-learn
On Thursday, 1 February 2018 at 21:42:33 UTC, Steven Schveighoffer wrote: On 2/1/18 4:36 PM, Jerry Ferris wrote: Hello, I'm developing a program that will either receive data from stdin or a file, and pass it along to a function for processing. I want to place this data into a buffer so

Re: Files and Buffers

2018-02-01 Thread Jerry Ferris via Digitalmars-d-learn
On Thursday, 1 February 2018 at 21:42:33 UTC, Steven Schveighoffer wrote: On 2/1/18 4:36 PM, Jerry Ferris wrote: https://dlang.org/phobos/std_file.html#read Then cast to ubyte[]. Thank you in advance, and I apologize if this is a very stupid question. Not a stupid question! -Steve On

Re: Files and Buffers

2018-02-01 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/1/18 4:36 PM, Jerry Ferris wrote: Hello, I'm developing a program that will either receive data from stdin or a file, and pass it along to a function for processing. I want to place this data into a buffer so there only has to be one version of the function. However, since I'm new to D,

Re: Files and Buffers

2018-02-01 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, February 01, 2018 21:36:52 Jerry Ferris via Digitalmars-d-learn wrote: > Hello, > > I'm developing a program that will either receive data from stdin > or a file, and pass it along to a function for processing. I want > to place this data into a buffer so there only has to be one >

Files and Buffers

2018-02-01 Thread Jerry Ferris via Digitalmars-d-learn
Hello, I'm developing a program that will either receive data from stdin or a file, and pass it along to a function for processing. I want to place this data into a buffer so there only has to be one version of the function. However, since I'm new to D, I'm unsure how to go about this in the