[Bio] / FigKernelScripts / Packager.pl Repository:
ViewVC logotype

Diff of /FigKernelScripts/Packager.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6, Wed Dec 7 19:38:22 2005 UTC revision 1.7, Thu Dec 6 14:00:37 2007 UTC
# Line 169  Line 169 
169    
170  =head3 ScanTree  =head3 ScanTree
171    
172  C<< ScanTree($directory); >>      ScanTree($directory);
173    
174  Scan all files in the specified directory and create an C<extensions.txt> file  Scan all files in the specified directory and create an C<extensions.txt> file
175  listing the extensions of files that are binary.  listing the extensions of files that are binary.
# Line 229  Line 229 
229    
230  =head3 ScanFile  =head3 ScanFile
231    
232  C<< my $type = ScanFile($fileName, $size); >>      my $type = ScanFile($fileName, $size);
233    
234  Survey the specified file of the specified size to determine whether it is  Survey the specified file of the specified size to determine whether it is
235  text or binary. A file is binary if it has a lot of control characters or  text or binary. A file is binary if it has a lot of control characters or
# Line 289  Line 289 
289    
290  =head3 OpenDirectory  =head3 OpenDirectory
291    
292  C<< my $dirObject = OpenDirectory($directoryName); >>      my $dirObject = OpenDirectory($directoryName);
293    
294  This method returns an object that can be used to find all the files in a directory  This method returns an object that can be used to find all the files in a directory
295  tree. The incoming parameter is the directory tree name, properly cleaned and with  tree. The incoming parameter is the directory tree name, properly cleaned and with
# Line 315  Line 315 
315    
316  =head3 GetFileName  =head3 GetFileName
317    
318  C<< my $fileName = GetFileName($dirObject); >>      my $fileName = GetFileName($dirObject);
319    
320  This method returns the next file name for a directory tree. The incoming parameter is  This method returns the next file name for a directory tree. The incoming parameter is
321  a directory object returned by OpenDirectory. If all the files have been processed, the  a directory object returned by OpenDirectory. If all the files have been processed, the
# Line 368  Line 368 
368    
369  =head3 InSummary  =head3 InSummary
370    
371  C<< print InSummary($dirObject); >>      print InSummary($dirObject);
372    
373  Return a summary of the files processed by a directory object.  Return a summary of the files processed by a directory object.
374    
# Line 385  Line 385 
385    
386  =head3 NameParse  =head3 NameParse
387    
388  C<< my ($path, $suffix) = NameParse($fileName); >>      my ($path, $suffix) = NameParse($fileName);
389    
390  Separate the directory path and suffix out of a file name. Note that if the suffix  Separate the directory path and suffix out of a file name. Note that if the suffix
391  is entirely numeric, we return a suffix of "#".  is entirely numeric, we return a suffix of "#".
# Line 413  Line 413 
413    
414  =head3 StartFile  =head3 StartFile
415    
416  C<< StartFile($mode, $fileName); >>      StartFile($mode, $fileName);
417    
418  Open the specified file for compression input. The file handle used is CLEARFILE.  Open the specified file for compression input. The file handle used is CLEARFILE.
419    
# Line 435  Line 435 
435    
436  =head3 GetCharacters  =head3 GetCharacters
437    
438  C<< my $characters = GetCharacters($mode); >>      my $characters = GetCharacters($mode);
439    
440  Get some characters to compress from the current input file. If we have reached  Get some characters to compress from the current input file. If we have reached
441  end-of-file, returns an empty list.  end-of-file, returns an empty list.
# Line 480  Line 480 
480    
481  =head3 GetExtensions  =head3 GetExtensions
482    
483  C<< my %extHash = GetExtensions($directory); >>      my %extHash = GetExtensions($directory);
484    
485  Create a hash containing the extensions of the binary files in the specified  Create a hash containing the extensions of the binary files in the specified
486  directory tree.  directory tree.
# Line 510  Line 510 
510    
511  =head3 StartPackaging  =head3 StartPackaging
512    
513  C<< my $packObject = StartPackaging($packageFileName); >>      my $packObject = StartPackaging($packageFileName);
514    
515  Prepare to create the package file.  Prepare to create the package file.
516    
# Line 533  Line 533 
533    
534  =head3 WritePackageLine  =head3 WritePackageLine
535    
536  C<< WritePackageLine($packObject, $line); >>      WritePackageLine($packObject, $line);
537    
538  Write a line of text data to the package file. A text line is preceded by a space character  Write a line of text data to the package file. A text line is preceded by a space character
539  and is terminated by a line feed character.  and is terminated by a line feed character.
# Line 551  Line 551 
551    
552  =head3 FinishPackaging  =head3 FinishPackaging
553    
554  C<< FinishPackaging($packObject); >>      FinishPackaging($packObject);
555    
556  Finish the packaging process. This basically closes the package file.  Finish the packaging process. This basically closes the package file.
557    
# Line 563  Line 563 
563    
564  =head3 StartCompressedData  =head3 StartCompressedData
565    
566  C<< StartCompressedData($packObject, $compTable); >>      StartCompressedData($packObject, $compTable);
567    
568  Initialize for writing compressed file data. Compressed file data is output in fixed-  Initialize for writing compressed file data. Compressed file data is output in fixed-
569  length blocks preceded by a C<b> character. (This distinguishes them from text lines,  length blocks preceded by a C<b> character. (This distinguishes them from text lines,
# Line 587  Line 587 
587    
588  =head3 WriteCompressedData  =head3 WriteCompressedData
589    
590  C<< WriteCompressedData($packObject, $data, $status); >>      WriteCompressedData($packObject, $data, $status);
591    
592  Add a block of data to the compressed output. The data is accumulated until we fill  Add a block of data to the compressed output. The data is accumulated until we fill
593  an entire block, at which time it is written to the file with the appropriate marker.  an entire block, at which time it is written to the file with the appropriate marker.
# Line 630  Line 630 
630    
631  =head3 WriteEndMark  =head3 WriteEndMark
632    
633  C<< my $outCount = WriteEndMark($packObject); >>      my $outCount = WriteEndMark($packObject);
634    
635  Write out the last block of a compressed data stream and return the total number of bytes  Write out the last block of a compressed data stream and return the total number of bytes
636  in the stream.  in the stream.
# Line 660  Line 660 
660    
661  =head3 PackTree  =head3 PackTree
662    
663  C<< PackTree($directory, $packageFileName); >>      PackTree($directory, $packageFileName);
664    
665  Package all files in a directory tree into a package file.  Package all files in a directory tree into a package file.
666    
# Line 707  Line 707 
707    
708  =head3 PackFile  =head3 PackFile
709    
710  C<< PackFile($fileName, $packObject, $mode); >>      PackFile($fileName, $packObject, $mode);
711    
712  Compress the specified file to the specified package file in the specified mode.  Compress the specified file to the specified package file in the specified mode.
713    
# Line 744  Line 744 
744    
745  =head3 UnPackTree  =head3 UnPackTree
746    
747  C<< UnPackTree($directory, $packageFile); >>      UnPackTree($directory, $packageFile);
748    
749  Read file data from a package file and put it into a directory tree.  Read file data from a package file and put it into a directory tree.
750    
# Line 809  Line 809 
809    
810  =head3 StartUnPacking  =head3 StartUnPacking
811    
812  C<< my $packObject = StartUnPacking($packageFile); >>      my $packObject = StartUnPacking($packageFile);
813    
814  Prepare to read from a package file.  Prepare to read from a package file.
815    
# Line 829  Line 829 
829    
830  =head3 GetTextRecord  =head3 GetTextRecord
831    
832  C<< my $data = GetTextRecord($packObject); >>      my $data = GetTextRecord($packObject);
833    
834  Read a text record from the package file. The text record begins with a space and  Read a text record from the package file. The text record begins with a space and
835  ends with a new-line character.  ends with a new-line character.
# Line 877  Line 877 
877    
878  =head3 GetBlock  =head3 GetBlock
879    
880  C<< my $block = GetBlock($packObject); >>      my $block = GetBlock($packObject);
881    
882  Read a block of compressed data from the package file. If the end of the compressed data  Read a block of compressed data from the package file. If the end of the compressed data
883  has been reached, will return an undefined value.  has been reached, will return an undefined value.
# Line 955  Line 955 
955    
956  =head3 CreateFile  =head3 CreateFile
957    
958  C<< my $fileObject = CreateFile($fileName, $mode, $directory, $compObject); >>      my $fileObject = CreateFile($fileName, $mode, $directory, $compObject);
959    
960  Create a file into which packaged data can be unpacked.  Create a file into which packaged data can be unpacked.
961    
# Line 998  Line 998 
998    
999  =head3 WriteData  =head3 WriteData
1000    
1001  C<< WriteData($fileObject, $data, $status); >>      WriteData($fileObject, $data, $status);
1002    
1003  Write a block of data to the output file.  Write a block of data to the output file.
1004    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3