Strikes me that this doesn't work for directories yet, but we can add that when we need it.