paragonie/halite

MutableFile constructed with string assumes that file exists

Furgas opened this issue · 6 comments

Is this desired behaviour that we should create the output file before calling ex. File::encrypt()? What's the reasoning?

Is this desired behaviour that we should create the output file before calling ex. File::encrypt()? What's the reasoning?

In older versions of halite it was not required, so it seems to be a change that should be reviewed - Is it really desired behaviour?

454d9df7baeddc1365e629537186ca1a0906e574 was the commit with that change in MutableFile class.

Good to know. So, I guess, it should be answered by the commit author.

Any news on this? We are having similar issues after upgrading to latest version. Do we really need to have the output file created prior to passing it to encrypt?

I guess another option for us is to wrap the filename string var in fopen(), where it will automatically try to create the file if its missing

D'oh! WritableFile should be allowed to not exist before creation. This is a bug. I'll fix it ASAP.

This is fixed in v4.5.2. Thanks for reporting it.