of_getdiskspace


pfcapsrv.pbl   >   pfc_n_cst_filesrvunicode   >   of_getdiskspace   

Full name pfc_n_cst_filesrvunicode.of_getdiskspace
Access public
Extend of integer
Return value integer
Prototype public function integer of_getdiskspace(string,ref long,ref long)

Name Datatype
No Data

Name Datatype
ll_BytesPerSect Long
ll_ClusterBytes Long
ll_FreeClusters Long
ll_SectPerCluster Long
ll_TotalClusters Long
ls_string string

public function integer of_getdiskspace (string as_drive, ref long al_totalspace, ref long al_freespace);//////////////////////////////////////////////////////////////////////////////
//	Public Function:  of_GetDiskSpace
//	Arguments:		as_Drive					The letter of the drive to be checked.
//						al_TotalSpace			The total number of bytes on the drive, passed by reference.
//						al_FreeSpace			The number of bytes free, passed by reference.
//	Returns:			Integer
//						1 if successful, -1 if an error occurrs.
//	Description:	Get space information about a drive.
//////////////////////////////////////////////////////////////////////////////
//	Rev. History:	Version
//						5.0   	Initial version
// 					5.0.03	Changed argument datatype to string from char to fix polymorphism problem
//								with literals passed in.
//////////////////////////////////////////////////////////////////////////////
//	Copyright © 1996-1999 Sybase, Inc. and its subsidiaries.  All rights reserved.  Any distribution of the 
// PowerBuilder Foundation Classes (PFC) source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//////////////////////////////////////////////////////////////////////////////
Long		ll_SectPerCluster, ll_BytesPerSect, ll_FreeClusters, ll_TotalClusters, ll_ClusterBytes
string	ls_string

ls_string = Upper(left(as_drive,1)) + ":\"

If Not GetDiskFreeSpaceW(ls_string, ll_SectPerCluster, ll_BytesPerSect, &
									ll_FreeClusters, ll_TotalClusters) Then Return -1

ll_ClusterBytes = ll_SectPerCluster * ll_BytesPerSect
al_TotalSpace = ll_ClusterBytes * ll_TotalClusters
al_FreeSpace = ll_ClusterBytes * ll_FreeClusters

Return 1
end function

     
Name Owner
No Data

     
Name Owner
systemfunctions.left systemfunctions
systemfunctions.upper systemfunctions
pfc_n_cst_filesrvunicode.GetDiskFreeSpaceW pfc_n_cst_filesrvunicode

     
Full name
No Data

     
Name Scope
No Data