Skip to content

php SplFileObject and the difference between fgetcsv and current

I had to investigate a bug and figured out a strange behavior in the SplFileObject implementation of php. I know, some of you would add "again", but this does not matter.
To illustrate this problem, I created a little example file. If you run it, you get the following output:


generating content.
..........
writing content.
..........
using fgetcsv and writing key 13 times.
0 0 1 2 3 4 5 6 7 8 9 10 10 
using current and writing key 13 times.
0 0 0 0 0 0 0 0 0 0 0 0 0

As you can see, if you use "fgetcsv", the current key is move to the next step.
If you use "current", the current key won't get updated (which is most likely what you want).
You can easily set the csv delimiter etc. by using setCsvControl()".

zfs as root with luks on arch linux and the small trouble after upgrading the kernel

Everytime the kernel gets updated, my system only reaches the busybox afterwards.
Currently, I have no idea why this happens exactly. But at least, I know how to handle it.
The zfs module is loaded, so all you need to do is to execute

zpool import -f 
, followed by an
zpool export 
.
It looks like there is a problem with exporting the pool while rebooting, or maybe an error while importing. It is marked as "not exported correctly", that is why booting fails. After the two commands from above, you can enter
reboot
and everything should be fine again.