env_update: ensure_dirs, encode filename