Can we do compile time reading part of a file using import?

data pulverizer data.pulverizer at
Fri Oct 23 16:42:00 UTC 2020

Hi all,

the `import` function allows a file to be read at compile time, 
which opens up great opportunities for (mostly binary) file IO, 
where data types can be coded into files - the user doesn't need 
to know data types ahead of time. As specified in my old blog 

Binary files can be very large and reading the whole file at 
compile time is often unnecessary.

This isn't exactly the intended use for the function, but there 
it is. Since compile time read capability already exists and is 
useful, adding capability to be able to read only a portion of 
the file at compile time in a given location is advantageous and 
has utility.

For me it's not make-or-break, it just something very useful and 
I think has clear use case. Please let me know if there are 
aspects or alternatives I am missing.


More information about the Digitalmars-d-learn mailing list