NWGetCompressedFileLengths

Returns information about the lengths of a compressed file

Local Servers:blocking
Remote Servers:blocking
NetWare Server:3.x, 4.x, 5.x, 6.x
Platform:NLM
Service:File System

Syntax

   #include <nwfinfo.h>  
    
   int NWGetCompressedFileLengths  (  
      int    handle,  
      LONG  *uncompressedLength,  
      LONG  *compressedLength;
   

Parameters

handle

(IN) Specifies the file handle for which to return the lengths.

uncompressedLength

(OUT) Points to the length of the file in an uncompressed state.

compressedLength

(OUT) Points to the length of the file after being compressed.

Return Values

0

Success

0xFF

Failure

Remarks

NWGetCompressedFileLengths returns information about the lengths of a compressed file.

If handle represents a file that is not compressed, the lengths will be invalid.

uncompressedLength specifies the length normally seen in directory listings.

The following code will open the file and enable it to be read without decompression:

   #include <nwfileng.h>
   #include <nwfattr.h>
   #include <fcntl.h>
   #include <sys/stat.h>
   #include <nwfinfo.h>void main()
   {
      int handle;
      LONG uncom, com;
   
      handle=FEsopen("sys:\\compress\\test",O_RDONLY,H_DENYWR,S_IREAD,
   	                        ENABLE_IO_ON_COMPRESSED_DATA_BIT, PrimaryDataStream);
      NWGetCompressedFileLengths(handle, &uncom, &com);
      printf("The compressed size is %d and the uncompressed size is %d.", com,   
                 uncom);
      close (handle);
   }
   

The important parameter to FEsopen is S_IREAD, ENABLE_IO_ON_COMPRESSED_DATA_BIT. If this bit is not set, NWGetCompressedFileLengths uncompresses the file as it is read, which causes the resulting data to be inaccurate and leaves the file in an uncompressed state.

See Also

NWSetCompressedFileLengths