Re: Prevent opening binary/other garbage files

2018-09-29 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 29 September 2018 at 23:46:26 UTC, helxi wrote: Thanks. Would you say https://dlang.org/library/std/encoding/get_bom.html is useful in this context? Eh, not really, most text files will not have one.

Re: Prevent opening binary/other garbage files

2018-09-29 Thread helxi via Digitalmars-d-learn
On Saturday, 29 September 2018 at 16:01:18 UTC, Adam D. Ruppe wrote: On Saturday, 29 September 2018 at 15:52:30 UTC, helxi wrote: I'm writing a utility that checks for specific keyword(s) found in the files in a given directory recursively. What's the best strategy to avoid opening a bin file

Re: vibe.d error

2018-09-29 Thread hridyansh thakur via Digitalmars-d-learn
On Friday, 28 September 2018 at 11:08:57 UTC, Sebastiaan Koppe wrote: On Thursday, 27 September 2018 at 17:37:43 UTC, hridyansh thakur wrote: [snip] What version of dmd do you use? i am using ldc and gdc not dmd LDC - the LLVM D compiler (1.11.0git-054d933): based on DMD v2.081.0 and

Re: Prevent opening binary/other garbage files

2018-09-29 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 29 September 2018 at 15:52:30 UTC, helxi wrote: I'm writing a utility that checks for specific keyword(s) found in the files in a given directory recursively. What's the best strategy to avoid opening a bin file or some sort of garbage dump? Check encoding of the given file?

Prevent opening binary/other garbage files

2018-09-29 Thread helxi via Digitalmars-d-learn
I'm writing a utility that checks for specific keyword(s) found in the files in a given directory recursively. What's the best strategy to avoid opening a bin file or some sort of garbage dump? Check encoding of the given file? If so, what are the most popular encodings (in POSIX if that

Re: Delegates with stackpointers

2018-09-29 Thread bauss via Digitalmars-d-learn
On Saturday, 29 September 2018 at 06:01:50 UTC, Ritchie wrote: How does a delegate with a stackpointer work? e.g. in this example: https://run.dlang.io/is/XviMSl Does the second call to foo not overwrite the stack of the first call and thereby the data pointed to by bar1? How is that data

Re: Delegates with stackpointers

2018-09-29 Thread Alex via Digitalmars-d-learn
On Saturday, 29 September 2018 at 06:01:50 UTC, Ritchie wrote: How does a delegate with a stackpointer work? e.g. in this example: https://run.dlang.io/is/XviMSl Does the second call to foo not overwrite the stack of the first call and thereby the data pointed to by bar1? How is that data

Delegates with stackpointers

2018-09-29 Thread Ritchie via Digitalmars-d-learn
How does a delegate with a stackpointer work? e.g. in this example: https://run.dlang.io/is/XviMSl Does the second call to foo not overwrite the stack of the first call and thereby the data pointed to by bar1? How is that data preserved?