[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] FTP client?



According to Jon S. Jaques:
> 
> Hi All,
> 
> I had to dredge this message out from a few days
> ago... hope I don't back-track too much, but I
> have a MacPerl [semi] newbie question.

Ok, how about this:

Find::File has already been shown that it will read (and
understand) whether or not a file is really a file or a
directory.  Ok, what if you kept two arrays.  The first
array is just a directory listing.  The second is only a
listing of the files for a particular directory.  In this
way you perform a two-pass file transfer.  The first one
simply scans the directories for subdirectories and places
them all into a directory array.  Then you sort the
directory array.  Then you do each of the non-directory
files for each directory and create the subdirectories.  In
this way you only have to keep a small number of files in
memory at one time.  This eliminates the memory problem.
The time to transfer should stay about the same though.  No
way around that unless you can equip your PBs with an
Ethernet device (which IS available for PBs which just use
the Appletalk connection).  We have such a set-up here at
work.  We go through a Gator box which pumps information
across the line at about 7-10K per second.  Fastest I've
seen (no other network traffic in the lab) was around 36K
per second.  Gator boxes are available from Cayman, Inc.
Look on Yahoo!, Alta Vista, etc... for more info.  Also,
you can count as you transfer files.  All it takes is a
"++" to some counter.  Like so:

	$numFiles = 0;
	while( <we have files> ){
		$numFiles++;
		.
		.
		.
		}


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch