easy-csv icon indicating copy to clipboard operation
easy-csv copied to clipboard

fopen($file, $mode);

Open xandout opened this issue 10 years ago • 2 comments

In AbstractBase.php you had the open mode as r+ which seemed to be causing the data to not be written. I adjusted my local copy to a+ and now have been able to get sequential writes.

http://www.php.net/manual/en/function.fopen.php

xandout avatar Jun 23 '14 20:06 xandout

maybe we should make an abstraction to support both as an option

cordoval avatar Jun 23 '14 21:06 cordoval

@xandout @cordoval the second constructor can be passed a different file mode. Currently AbstractBase::__construct() in master is doing a check to see if the file exists and if not it'll create it with touch. Assuming there isn't a file mode bug for SplFileObject, it'd be nice to remove the file check and just go with a+ by default. That's sort of a new ticket for improvement.

@xandout I'm thinking if the file exists and with r+ it wasn't writing, then something doesn't sound right. Do you have a way to reproduce the issue? What OS and PHP version you running?

jorgecolonconsulting avatar Sep 03 '14 05:09 jorgecolonconsulting