Hey Entro,
What does your question has to do with blueprints? Would you mind updating the title and tags to not mislead people?
Regarding the code, don’t. You’ll get yourself into lots of trouble if you put it in UE4 context (compilation, runtime and cook-time). UE4 has code for everything you’re trying to do in that code snippet. Do yourself a favor and dig through UE4 code and some samples on the internet and familiarize yourself with the related code. You can start by looking at FFileHelper
.
Cheers,
–mieszko