state at discussion with daniele
included Ceriotti's potential Fixed possible overflow for long filenames