b311480e |
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 |
5 | -- |
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. |
10 | -- |
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. |
13 | -- |
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. |
20 | |
7fd59977 |
21 | |
7fd59977 |
22 | |
7fd59977 |
23 | |
24 | |
25 | |
26 | class Disk from OSD |
27 | |
28 | ---Purpose: Disk management |
29 | |
30 | |
31 | uses Error, Path, CString from Standard, AsciiString from TCollection |
32 | raises OSDError |
33 | |
34 | |
35 | is |
36 | Create returns Disk; |
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. |
40 | ---Level: Public |
41 | |
42 | Create (Name : Path) returns Disk; |
43 | ---Purpose: Initializes the object Disk with the disk name |
44 | -- associated to the OSD_Path. |
45 | ---Level: Public |
46 | |
47 | Create (PathName : CString) returns Disk; |
48 | ---Purpose: Initializes the object Disk with <PathName>. |
49 | -- <PathName> specifies any file within the mounted |
50 | -- file system. |
51 | -- Example : OSD_Disk myDisk ("/tmp") |
52 | -- Initializes a disk object with the mounted |
53 | -- file associated to /tmp. |
54 | ---Level: Public |
55 | |
56 | Name (me ) returns Path is static; |
57 | ---Purpose: Returns disk name of <me>. |
58 | ---Level: Public |
59 | |
60 | SetName (me : in out; Name : Path) is static ; |
61 | ---Purpose: Instantiates <me> with <Name>. |
62 | ---Level: Public |
63 | |
64 | DiskSize(me : in out) returns Integer is static ; |
65 | ---Purpose: Returns total disk capacity in 512 bytes blocks. |
66 | ---Level: Advanced |
67 | |
68 | DiskFree(me : in out) returns Integer is static ; |
69 | ---Purpose: Returns free available 512 bytes blocks on disk. |
70 | ---Level: Advanced |
71 | |
72 | DiskQuota(me : in out) returns Integer is static ; |
73 | ---Purpose: Returns user's disk quota (in Bytes). |
74 | ---Level: Advanced |
75 | |
76 | SetDiskQuota(me : in out; QuotaSize : Integer) is static ; |
77 | ---Purpose: Sets user's disk quota (in Bytes). |
78 | -- Warning: Needs system administrator privilege. |
79 | ---Level: Advanced |
80 | |
81 | SetQuotaOn(me : in out) is static; |
82 | ---Purpose: Activates user's disk quota |
83 | -- Warning: Needs system administrator privilege. |
84 | ---Level: Advanced |
85 | |
86 | SetQuotaOff(me : in out) is static; |
87 | ---Purpose: Deactivates user's disk quota |
88 | -- Warning: Needs system administrator privilege. |
89 | ---Level: Advanced |
90 | |
91 | Failed (me) returns Boolean is static ; |
92 | ---Purpose: Returns TRUE if an error occurs |
93 | ---Level: Public |
94 | |
95 | Reset (me : in out) is static ; |
96 | ---Purpose: Resets error counter to zero |
97 | ---Level: Public |
98 | |
99 | Perror (me : in out) |
100 | ---Purpose: Raises OSD_Error |
101 | ---Level: Public |
102 | raises OSDError is static ; |
103 | |
104 | Error (me) returns Integer is static; |
105 | ---Purpose: Returns error number if 'Failed' is TRUE. |
106 | ---Level: Public |
107 | |
108 | fields |
109 | DiskName : AsciiString; |
110 | myQuotaSize: Integer; |
111 | myError : Error; |
112 | end Disk from OSD; |
113 | |
114 | |