On Friday, September 22, 2023 12:28:39 AM MDT Uranuz via Digitalmars-d-learn
wrote:
> OK. Thanks for response. I wish that there it was some API to
> handle it "out of the box". Do I need to write some issue or
> something in order to not forget about this?
You can open an issue if you want, thou
OK. Thanks for response. I wish that there it was some API to
handle it "out of the box". Do I need to write some issue or
something in order to not forget about this?
o width or endian conversions are performed. So, if
> the width or endianness of the characters in the given file
> differ from the width or endianness of the element type of S,
> then validation will fail.
> """
> So it's OK. But I understood that this function
Addition:
Current solution to this problemme that I was found is:
So I just check for BOM manually. Get length of bom.sequence and
remove that count of items from beginning. But I dont' think that
it's convenient solution, because `who knows` how much else
issues with UTF could happend. And I d
ess of the element type of S,
then validation will fail.
"""
So it's OK. But I understood that this function "readText" is not
usefull for me.
So I tried to use plain "read" that returns "void[]". Problemmme
is that I still don't understand wh
On Tuesday, 17 November 2015 at 13:00:11 UTC, Gary Willoughby
wrote:
On Tuesday, 17 November 2015 at 02:40:14 UTC, Domain wrote:
How to use readText to read utf16 file? Or other encoding file.
Here's a helpful resource when working with text files in D.
http://nomad.so/2015/09/working
Am Tue, 08 Aug 2017 20:48:39 +
schrieb Nordlöw :
> Has anybody written a wrapper around `std.file.readText` (or
> similar) that appends a final zero-byte terminator in order to
> realize sentinel-based search in textual parsers.
What do you mean by similar? There are many ways to load a fil
Has anybody written a wrapper around `std.file.readText` (or
similar) that appends a final zero-byte terminator in order to
realize sentinel-based search in textual parsers.
On Wednesday, 19 July 2017 at 15:18:00 UTC, Steven Schveighoffer
wrote:
On 7/17/17 10:21 PM, Enjoys Math wrote:
DMD32 D Compiler v2.074.1
import std.file;
void main() {
string bigInput = readText("input.txt");
}
The file is 7 MB of ascii text, don't know if that matte
On 7/17/17 10:21 PM, Enjoys Math wrote:
DMD32 D Compiler v2.074.1
import std.file;
void main() {
string bigInput = readText("input.txt");
}
The file is 7 MB of ascii text, don't know if that matters...
Should I upgrade versions?
Looking at the implementation of readText
On Tuesday, 18 July 2017 at 02:21:59 UTC, Enjoys Math wrote:
DMD32 D Compiler v2.074.1
import std.file;
void main() {
string bigInput = readText("input.txt");
}
The file is 7 MB of ascii text, don't know if that matters...
Should I upgrade versions?
Could you please sha
On Tuesday, 18 July 2017 at 02:21:59 UTC, Enjoys Math wrote:
DMD32 D Compiler v2.074.1
import std.file;
void main() {
string bigInput = readText("input.txt");
}
The file is 7 MB of ascii text, don't know if that matters...
Should I upgrade versions?
I wonder if it thinks
DMD32 D Compiler v2.074.1
import std.file;
void main() {
string bigInput = readText("input.txt");
}
The file is 7 MB of ascii text, don't know if that matters...
Should I upgrade versions?
On Tuesday, 17 November 2015 at 02:40:14 UTC, Domain wrote:
How to use readText to read utf16 file? Or other encoding file.
Here's a helpful resource when working with text files in D.
http://nomad.so/2015/09/working-with-files-in-the-d-programming-language/
On Tuesday, 17 November 2015 at 05:37:55 UTC, Domain wrote:
Thank you! Now another question: how to handle endianness?
If your file follow a file format:
the endianness should be defined there.
else it's a random text file:
either it will have a BOM with endianness,
or you will hav
On Tuesday, 17 November 2015 at 03:12:47 UTC, Steven
Schveighoffer wrote:
On 11/16/15 10:00 PM, Adam D. Ruppe wrote:
On Tuesday, 17 November 2015 at 02:50:44 UTC, Domain wrote:
Thanks! But how to remove BOM? Slice the result myself?
Yeah. Do something like if(result.length &&result[0] == bom)
On 11/16/15 10:00 PM, Adam D. Ruppe wrote:
On Tuesday, 17 November 2015 at 02:50:44 UTC, Domain wrote:
Thanks! But how to remove BOM? Slice the result myself?
Yeah. Do something like if(result.length &&result[0] == bom) { result =
result[1..$]; } and you'll have it.
To be technically correct
On Tuesday, 17 November 2015 at 02:50:44 UTC, Domain wrote:
Thanks! But how to remove BOM? Slice the result myself?
Yeah. Do something like if(result.length &&result[0] == bom) {
result = result[1..$]; } and you'll have it.
On Tuesday, 17 November 2015 at 02:42:29 UTC, Adam D. Ruppe wrote:
On Tuesday, 17 November 2015 at 02:40:14 UTC, Domain wrote:
How to use readText to read utf16 file?
readText!wstring("filename")
should do it for utf16. It will return a wstring, which is
utf-16.
You can do
How to use readText to read utf16 file? Or other encoding file.
On Tuesday, 17 November 2015 at 02:40:14 UTC, Domain wrote:
How to use readText to read utf16 file?
readText!wstring("filename")
should do it for utf16. It will return a wstring, which is utf-16.
You can do utf32 with readText!dstring. The default, of course,
is string, which is
Thanks. The bug is created.
https://issues.dlang.org/show_bug.cgi?id=14469
On 20/04/2015 7:06 a.m., Kenny wrote:
This function works fine for large text files like 100Mb or 1Gb but
failed when I tried to read 6Gb file. This happens on Windows x64.
The possible reason that it uses read(in char[], size_t) function and on
windows it calls GetFileSize. This function return
This function works fine for large text files like 100Mb or 1Gb
but failed when I tried to read 6Gb file. This happens on Windows
x64.
The possible reason that it uses read(in char[], size_t) function
and on windows it calls GetFileSize. This function returns file
size as 32 bit value. If you
On Wed, 19 Jun 2013 20:18:17 +0200, Daemon wrote:
> Was readText removed in later versions of Phobos? I don't have it, yet
> it appears in the documentation..
std.file.readText has been around for a long time and still is. Here it
is in Phobos HEAD: https://github.com/D-Programmi
On Wednesday, 19 June 2013 at 18:18:18 UTC, Daemon wrote:
Was readText removed in later versions of Phobos? I don't have
it, yet it appears in the documentation..
Sorry for the false alarm, I accidentally had a different copy.
Everything's alright.
On Wednesday, 19 June 2013 at 18:21:09 UTC, Justin Whear wrote:
On Wed, 19 Jun 2013 20:18:17 +0200, Daemon wrote:
Was readText removed in later versions of Phobos? I don't have
it, yet
it appears in the documentation..
std.file.readText has been around for a long time and still is.
He
Was readText removed in later versions of Phobos? I don't have
it, yet it appears in the documentation..
On Sunday, 17 June 2012 at 08:35:58 UTC, Jonathan M Davis wrote:
Also, you need to check exists before you check isFile,
otherwise isFile will
blow up if the file doesn't exst. And both of those are
properties, so you
should be calling them like
auto filename = args[1];
if(!filename.exists ||
Oh, I just figured out what was going wrong. Apparently, args[0]
is the path to the program itself, and not the first argument.
args[1] is what I need to start reading from!
On Sunday, June 17, 2012 10:21:17 GreatEmerald wrote:
> This is kind of silly, and I probably missed something, but for
> some reason I can't get any kind of text file opened when using
> readText from std.file. This is what I'm trying to do:
>
>import std.st
On 06/17/2012 01:21 AM, GreatEmerald wrote:
This is kind of silly, and I probably missed something, but for some
reason I can't get any kind of text file opened when using readText from
std.file. This is what I'm trying to do:
import std.stdio;
import std.file;
int main(string[]
On 17.06.2012 12:21, GreatEmerald wrote:
This is kind of silly, and I probably missed something, but for some
reason I can't get any kind of text file opened when using readText from
std.file. This is what I'm trying to do:
import std.stdio;
import std.file;
int main(string[]
This is kind of silly, and I probably missed something, but for
some reason I can't get any kind of text file opened when using
readText from std.file. This is what I'm trying to do:
import std.stdio;
import std.file;
int main(string[] args)
{
if (!isF
34 matches
Mail list logo