1 // Created on: 1992-05-27
2 // Created by: Stephan GARNAUD (ARM)
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _OSD_Disk_HeaderFile
18 #define _OSD_Disk_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TCollection_AsciiString.hxx>
25 #include <Standard_Integer.hxx>
26 #include <OSD_Error.hxx>
27 #include <Standard_CString.hxx>
28 #include <Standard_Boolean.hxx>
33 //! Disk management (a set of disk oriented tools)
41 //! Creates a disk object.
42 //! This is used only when a class contains a Disk field.
43 //! By default, its name is initialized to current working disk.
44 Standard_EXPORT OSD_Disk();
46 //! Initializes the object Disk with the disk name
47 //! associated to the OSD_Path.
48 Standard_EXPORT OSD_Disk(const OSD_Path& Name);
50 //! Initializes the object Disk with <PathName>.
51 //! <PathName> specifies any file within the mounted
53 //! Example : OSD_Disk myDisk ("/tmp")
54 //! Initializes a disk object with the mounted
55 //! file associated to /tmp.
56 Standard_EXPORT OSD_Disk(const Standard_CString PathName);
58 //! Returns disk name of <me>.
59 Standard_EXPORT OSD_Path Name() const;
61 //! Instantiates <me> with <Name>.
62 Standard_EXPORT void SetName (const OSD_Path& Name);
64 //! Returns total disk capacity in 512 bytes blocks.
65 Standard_EXPORT Standard_Integer DiskSize();
67 //! Returns free available 512 bytes blocks on disk.
68 Standard_EXPORT Standard_Integer DiskFree();
70 //! Returns user's disk quota (in Bytes).
71 Standard_EXPORT Standard_Integer DiskQuota();
73 //! Sets user's disk quota (in Bytes).
74 //! Warning: Needs system administrator privilege.
75 Standard_EXPORT void SetDiskQuota (const Standard_Integer QuotaSize);
77 //! Activates user's disk quota
78 //! Warning: Needs system administrator privilege.
79 Standard_EXPORT void SetQuotaOn();
81 //! Deactivates user's disk quota
82 //! Warning: Needs system administrator privilege.
83 Standard_EXPORT void SetQuotaOff();
85 //! Returns TRUE if an error occurs
86 Standard_EXPORT Standard_Boolean Failed() const;
88 //! Resets error counter to zero
89 Standard_EXPORT void Reset();
92 Standard_EXPORT void Perror();
94 //! Returns error number if 'Failed' is TRUE.
95 Standard_EXPORT Standard_Integer Error() const;
110 TCollection_AsciiString DiskName;
111 Standard_Integer myQuotaSize;
123 #endif // _OSD_Disk_HeaderFile