{$X+,B-,V-} {essential compiler directives} program uspace; { Example for the nwFile unit / NwTP 0.6 API. (c) 1993,1995, R.Spronk } { Purpose: A quick way of telling how much space each of your users is taking up. For Novell 3.x networks. (3867) Tue 29 Mar 94 19:01 By: Richard Jary To: All Re: Disk Space by Login Name St: ------------------------------------------------------------ After a quick way of telling how much space each of our users is taking up. Novell 3.11 system, same info as you get by SYSCON -> UserInfo -> Volume/Disk Restrictions. But preferably for all users in a text file format, rather than one by one. Reason - we have a shared area with many directories. All with fun names like CAMBODIA, where any one of 10 people could be saving stuff. I'd like to go the the (l)users and say "OI! - You've got 40MB of stuff on this server - Clean It Up!" sort of thing. Either more or less polite depending on the user involved! Richard Internet: rjary@nibueng.ccdn.otc.com.au --- msgedsq 2.1a * Origin: Networking from Narara. (3:711/445) } Uses nwMisc,nwBindry,nwFile; Var lastObjSeen : Longint; RepName : String; RepType : Word; RepId : LongInt; RepFlag : Byte; RepSecurity : Byte; RepHasProperties: Boolean; FullUserName : string; MaxAllowedBlocks,BlocksInUse:Longint; VolumeNbr : Byte; VolUsageInfo : TvolUsage; Version : Word; VolInfo:array[0..31] of record Name :string; SectorsPerBlock:Byte; end; begin If NOT IsShellLoaded then begin writeln('USPACE requires:'); writeln(' -The shell to be loaded;'); halt(1); end; GetNWversion(version); if version<300 then begin writeln('Netware 3.x only.'); halt(1); end; for VolumeNbr:=0 to 31 do begin IF GetVolumeName(VolumeNbr,VolInfo[VolumeNbr].name) and GetVolumeUsage(VolumeNbr,VolUsageInfo) then VolInfo[VolumeNbr].SectorsPerBlock:=VolUsageInfo.SectorsPerBlock; end; lastObjSeen:=-1; While ScanBinderyObject('*',OT_USER, lastObjSeen, RepName,RepType,RepId,RepFlag,RepSecurity,RepHasProperties) do begin GetRealUserName(RepName,FullUserName); writeln(Repname+' ('+FullUserName+')'); For VolumeNbr:=0 to 31 do if GetObjectVolRestriction(VolumeNbr,RepId,MaxAllowedBlocks,BlocksInUse) then begin write(' ',volInfo[VolumeNbr].Name,' :', BlocksInUse*(VolInfo[VolumeNbr].SectorsPerBlock DIV 2),' Kb.'); if MaxAllowedBlocks=$40000000 then writeln else writeln(' Restriction: ',MaxAllowedBlocks*4,' Kb.'); end; end; if nwBindry.Result=$FC { NO_SUCH_OBJECT, indicates end of search } then writeln('') else writeln('error scanning bindery:',HexStr( nwBindry.Result,2)); end.