buffer.putByte((byte) SSH_FXP_NAME);
buffer.putInt(id);
int wpos = buffer.wpos();
buffer.putInt(0);
int nb = 0;
while (files.hasNext() && buffer.wpos() < MAX_PACKET_LENGTH) {
SshFile f = files.next();
buffer.putString(f.getName());
buffer.putString(getLongName(f)); // Format specified in the specs
writeAttrs(buffer, f, false);
nb++;