1 -- Created on: 1992-05-27
2 -- Created by: Stephan GARNAUD (ARM)
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
28 ---Purpose: Disk management
31 uses Error, Path, CString from Standard, AsciiString from TCollection
37 ---Purpose: Creates a disk object.
38 -- This is used only when a class contains a Disk field.
39 -- By default, its name is initialized to current working disk.
42 Create (Name : Path) returns Disk;
43 ---Purpose: Initializes the object Disk with the disk name
44 -- associated to the OSD_Path.
47 Create (PathName : CString) returns Disk;
48 ---Purpose: Initializes the object Disk with <PathName>.
49 -- <PathName> specifies any file within the mounted
51 -- Example : OSD_Disk myDisk ("/tmp")
52 -- Initializes a disk object with the mounted
53 -- file associated to /tmp.
56 Name (me ) returns Path is static;
57 ---Purpose: Returns disk name of <me>.
60 SetName (me : in out; Name : Path) is static ;
61 ---Purpose: Instantiates <me> with <Name>.
64 DiskSize(me : in out) returns Integer is static ;
65 ---Purpose: Returns total disk capacity in 512 bytes blocks.
68 DiskFree(me : in out) returns Integer is static ;
69 ---Purpose: Returns free available 512 bytes blocks on disk.
72 DiskQuota(me : in out) returns Integer is static ;
73 ---Purpose: Returns user's disk quota (in Bytes).
76 SetDiskQuota(me : in out; QuotaSize : Integer) is static ;
77 ---Purpose: Sets user's disk quota (in Bytes).
78 -- Warning: Needs system administrator privilege.
81 SetQuotaOn(me : in out) is static;
82 ---Purpose: Activates user's disk quota
83 -- Warning: Needs system administrator privilege.
86 SetQuotaOff(me : in out) is static;
87 ---Purpose: Deactivates user's disk quota
88 -- Warning: Needs system administrator privilege.
91 Failed (me) returns Boolean is static ;
92 ---Purpose: Returns TRUE if an error occurs
95 Reset (me : in out) is static ;
96 ---Purpose: Resets error counter to zero
100 ---Purpose: Raises OSD_Error
102 raises OSDError is static ;
104 Error (me) returns Integer is static;
105 ---Purpose: Returns error number if 'Failed' is TRUE.
109 DiskName : AsciiString;
110 myQuotaSize: Integer;