Operating System - HP-UX
1754019 Members
7736 Online
108811 Solutions
New Discussion юеВ

size limit of the ls command in ftp

 
GUYODO
New Member

size limit of the ls command in ftp

On HPUX 11, using the standard FTP, I have to do the command :
ftp> ls * outputfile
If the current remote directory contains less than 997 files, OK. But if there's more than 997 files, the output file will contain only 997 lines.
Is it a bug ?
If it isn't, how can I change it ? I need to manage more than 997 files, using a mask, and on output file.
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: size limit of the ls command in ftp

swinstall -l product | grep ftp

This will display the version of ftpd you are running.

Are you current on security alerts and binary patches for ftpd? There have been several.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
GUYODO
New Member

Re: size limit of the ls command in ftp

I haven't root privilege, so I can't make a swinstall. sorry.
But I watched patch details concerning ftp, and I didn't find anything concerning this problem.
I'll try to have ftpd version.
Bill Hassell
Honored Contributor

Re: size limit of the ls command in ftp

ls is not an ftp command, it is a shorthand way to tell the remote ftp server (ftp daemon on another HP-UX box for example) to list the files. For HP-UX, ftpd will invoke /sbin/ls. However, just like any shell, there are character limits to the buffers available and most likely you are hitting the internal limits for ftpd (or whatever remote ftp server you are using).

Massively large flat directories are always a big problem to manage. ftp is not a shell so even though sh/ksh can list some files with masks, even the shell will max out at some point (about 2megs of command line space for 11.11). It is very likely that ftp does not have nearly this much space available. The only solution would be to create subdirectories.


Bill Hassell, sysadmin
GUYODO
New Member

Re: size limit of the ls command in ftp

Thanks for these explanations.
There's something strange : in ftp, if I make a ls to an output file, I can have into my file more than 997 lines. But if I use a mask in the ls command, the output file will be limited to 997 lines.
I don't understand why this limit is only when using a mask.
And If there's a size limit, I think I'm so far away that limit with 997 lines !
Bill Hassell
Honored Contributor

Re: size limit of the ls command in ftp

Change the length of the filenames and you'll see it isn't 997, it's the total length of 997 filenames all strung together. When you use a mask, the entire list must be read and processed, usually in memory. ls without a mask is most likely read one filename at a time and sent to your screen.


Bill Hassell, sysadmin
GUYODO
New Member

Re: size limit of the ls command in ftp

Thanks...
So there's nothing I can do but changing the way to manage these files.
I'll try to find a new way to work (in fact it's not my work, but the way one of our soft work).