1 <Type Name="UnixDriveInfo" FullName="Mono.Unix.UnixDriveInfo">
2 <TypeSignature Language="C#" Value="public sealed class UnixDriveInfo" />
3 <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit UnixDriveInfo extends System.Object" />
5 <AssemblyName>Mono.Posix</AssemblyName>
6 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
7 <AssemblyVersion>2.0.0.0</AssemblyVersion>
8 <AssemblyVersion>4.0.0.0</AssemblyVersion>
10 <ThreadingSafetyStatement>All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.</ThreadingSafetyStatement>
12 <BaseTypeName>System.Object</BaseTypeName>
16 <summary>Represents information about Unix volumes.</summary>
19 The <see cref="T:Mono.Unix.UnixDriveInfo" /> class presents
20 information about a Unix mount point or special file. It allows basic
21 querying about the filesystem
26 Total size and free disk space
27 (<see cref="P:Mono.Unix.UnixDriveInfo.TotalSize" /> and
28 <see cref="P:Mono.Unix.UnixDriveInfo.TotalFreeSpace" />).
33 Querying of all availble disk drives,
34 <see cref="M:Mono.Unix.UnixDriveInfo.GetDrives" />,
35 visible through <c>/etc/fstab</c>.
40 Information provided this type may not be valid for any significant
41 period of time, due to potential race conditions with other processes
42 running on the system or because of other actions being performed
43 within the current process.
46 The only gurantee is that the information provided <i>was</i> valid at
47 some point in time, <i>or</i> an
48 <see cref="T:System.InvalidOperationException" /> will be thrown
49 when attempting to access the provided information.
50 <block subset="none" type="note">
51 To clarify, most properties will attempt to refresh the information
52 before returning it so that the information retrieved is as
53 up-to-date as possible, but it cannot take everything into
57 Check the individual method and property documentation to determine
58 if and when an exception will be thrown.
63 <Member MemberName=".ctor">
64 <MemberSignature Language="C#" Value="public UnixDriveInfo (string mountPoint);" />
65 <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string mountPoint) cil managed" />
66 <MemberType>Constructor</MemberType>
68 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
69 <AssemblyVersion>2.0.0.0</AssemblyVersion>
70 <AssemblyVersion>4.0.0.0</AssemblyVersion>
73 <Parameter Name="mountPoint" Type="System.String" />
76 <param name="mountPoint">
77 A <see cref="T:System.String" /> containing the Unix mount point to
78 get information about.
81 Creates a <see cref="T:Mono.Unix.UnixDriveInfo" /> instance
82 containing information about a Unix mount point and volume.
86 <exception cref="T:System.ArgumentException">
87 <paramref name="mountPoint" /> isn't a valid mount point.
89 <exception cref="T:System.ArgumentNullException">
90 <paramref name="mountPoint" /> is <see langword="null" />.
92 <altmember cref="M:Mono.Unix.Native.Syscall.getfsfile" />
95 <Member MemberName="AvailableFreeSpace">
96 <MemberSignature Language="C#" Value="public long AvailableFreeSpace { get; }" />
97 <MemberSignature Language="ILAsm" Value=".property instance int64 AvailableFreeSpace" />
98 <MemberType>Property</MemberType>
100 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
101 <AssemblyVersion>2.0.0.0</AssemblyVersion>
102 <AssemblyVersion>4.0.0.0</AssemblyVersion>
105 <ReturnType>System.Int64</ReturnType>
108 <summary>Gets the available free space for the drive.</summary>
110 A <see cref="T:System.Int64" /> containing the total available
111 free space on the drive.
115 The available free space is the space that normal users are able
116 to write to (in the absense of file system quotas which may
117 further limit how much disk space users can fill). The drive may
118 have some space reserved for the super-user (<c>root</c>).
121 Use <see cref="P:Mono.Unix.UnixDriveInfo.TotalFreeSpace" /> for
122 the total free space, including space reserved for the super-user.
125 <exception cref="T:System.InvalidOperationException">
126 There was an error retrieving the total disk space.
127 The volume may not be mounted.
131 <Member MemberName="DriveFormat">
132 <MemberSignature Language="C#" Value="public string DriveFormat { get; }" />
133 <MemberSignature Language="ILAsm" Value=".property instance string DriveFormat" />
134 <MemberType>Property</MemberType>
136 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
137 <AssemblyVersion>2.0.0.0</AssemblyVersion>
138 <AssemblyVersion>4.0.0.0</AssemblyVersion>
141 <ReturnType>System.String</ReturnType>
145 Retrieves the file system format of the
146 <paramref name="mountPoint" /> volume.
149 A <see cref="T:System.String" /> containing the file system format
150 of the specified mount point.
154 <altmember cref="F:Mono.Unix.Native.Fstab.fs_vfstype" />
157 <Member MemberName="DriveType">
158 <MemberSignature Language="C#" Value="public Mono.Unix.UnixDriveType DriveType { get; }" />
159 <MemberSignature Language="ILAsm" Value=".property instance valuetype Mono.Unix.UnixDriveType DriveType" />
160 <MemberType>Property</MemberType>
162 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
163 <AssemblyVersion>2.0.0.0</AssemblyVersion>
164 <AssemblyVersion>4.0.0.0</AssemblyVersion>
167 <ReturnType>Mono.Unix.UnixDriveType</ReturnType>
170 <summary>Gets the drive type.</summary>
172 A <see cref="T:Mono.Unix.UnixDriveType" /> specifying which type of
173 drive this mount point is.
176 Currently, this always returns
177 <see cref="F:Mono.Unix.UnixDriveType.Unknown" />.
181 <Member MemberName="GetDrives">
182 <MemberSignature Language="C#" Value="public static Mono.Unix.UnixDriveInfo[] GetDrives ();" />
183 <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Mono.Unix.UnixDriveInfo[] GetDrives() cil managed" />
184 <MemberType>Method</MemberType>
186 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
187 <AssemblyVersion>2.0.0.0</AssemblyVersion>
188 <AssemblyVersion>4.0.0.0</AssemblyVersion>
191 <ReturnType>Mono.Unix.UnixDriveInfo[]</ReturnType>
195 <summary>Gets information about all drives listed in <c>/etc/fstab</c>.</summary>
197 A <see cref="T:Mono.Unix.UnixDriveInfo" /> array containing all
198 drives listed in <c>/etc/fstab</c>.
202 This method only <i>conceptually</i> reads <c>/etc/fstab</c>;
203 it actually uses the corresponding
204 <see cref="T:Mono.Unix.Native.Syscall" /> APIs, which may or may
205 not actually read <c>/etc/fstab</c> (check your operating system
209 This method does not return <c>/etc/fstab</c> entries which do not
210 correspond to actual mount points.
211 <see cref="F:Mono.Unix.Native.Fstab.fs_file" /> must start with a
215 <exception cref="T:System.IO.IOException">
216 There was an error calling
217 <see cref="M:Mono.Unix.Native.Syscall.setfsent" />.
219 <altmember cref="M:Mono.Unix.Native.Syscall.setfsent" />
220 <altmember cref="M:Mono.Unix.Native.Syscall.getfsent" />
221 <altmember cref="M:Mono.Unix.Native.Syscall.endfsent" />
224 <Member MemberName="GetForSpecialFile">
225 <MemberSignature Language="C#" Value="public static Mono.Unix.UnixDriveInfo GetForSpecialFile (string specialFile);" />
226 <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Mono.Unix.UnixDriveInfo GetForSpecialFile(string specialFile) cil managed" />
227 <MemberType>Method</MemberType>
229 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
230 <AssemblyVersion>2.0.0.0</AssemblyVersion>
231 <AssemblyVersion>4.0.0.0</AssemblyVersion>
234 <ReturnType>Mono.Unix.UnixDriveInfo</ReturnType>
237 <Parameter Name="specialFile" Type="System.String" />
240 <param name="specialFile">
241 A <see cref="T:System.String" /> containing the "special file"
242 (block device, generally the first field in <c>/etc/fstab</c>).
245 Creates a <see cref="T:Mono.Unix.UnixDriveInfo" /> instance
246 containing information about the specified block device name.
249 A <see cref="T:Mono.Unix.UnixDriveInfo" /> instance containing
250 information about the specified special file (block device).
254 <altmember cref="M:Mono.Unix.Native.Syscall.getfsspec" />
257 <Member MemberName="IsReady">
258 <MemberSignature Language="C#" Value="public bool IsReady { get; }" />
259 <MemberSignature Language="ILAsm" Value=".property instance bool IsReady" />
260 <MemberType>Property</MemberType>
262 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
263 <AssemblyVersion>2.0.0.0</AssemblyVersion>
264 <AssemblyVersion>4.0.0.0</AssemblyVersion>
267 <ReturnType>System.Boolean</ReturnType>
271 Returns a <see cref="T:System.Boolean" /> indicating whether the
272 specified mount point is connected and queryable.
275 A <see cref="T:System.Boolean" /> indicating whether the
276 specified mount point is connected and queryable.
280 This property generates no exceptions.
283 If this property returns <see langword="true" />, then the other
284 properties should not generate
285 <see cref="T:System.InvalidOperationException" />s.
290 <Member MemberName="MaximumFilenameLength">
291 <MemberSignature Language="C#" Value="public long MaximumFilenameLength { get; }" />
292 <MemberSignature Language="ILAsm" Value=".property instance int64 MaximumFilenameLength" />
293 <MemberType>Property</MemberType>
295 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
296 <AssemblyVersion>2.0.0.0</AssemblyVersion>
297 <AssemblyVersion>4.0.0.0</AssemblyVersion>
300 <ReturnType>System.Int64</ReturnType>
303 <summary>Gets the maximum filename length.</summary>
305 A <see cref="T:System.Int64" /> containing the maximum number of
306 bytes that may make up a filename. This value varies from
307 filesystem to filesystem.
311 The operating system does not specify an encoding for filenames,
312 it just stores the bytes given to it. Since
313 <see cref="T:System.String" /> is a UTF-16 string encoding, each
314 character may require more than one byte to store in the
315 filesystem. Consequently the maximum filename length can
316 <i>not</i> be directly compared against
317 <see cref="P:System.String.Length" />.
320 <exception cref="T:System.InvalidOperationException">
321 There was an error retrieving the maximum filename length.
322 The volume may not be mounted.
326 <Member MemberName="Name">
327 <MemberSignature Language="C#" Value="public string Name { get; }" />
328 <MemberSignature Language="ILAsm" Value=".property instance string Name" />
329 <MemberType>Property</MemberType>
331 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
332 <AssemblyVersion>2.0.0.0</AssemblyVersion>
333 <AssemblyVersion>4.0.0.0</AssemblyVersion>
336 <ReturnType>System.String</ReturnType>
339 <summary>Gets the mount point.</summary>
341 A <see cref="T:System.String" /> containinig the mount point of the
346 <altmember cref="F:Mono.Unix.Native.Fstab.fs_file" />
349 <Member MemberName="RootDirectory">
350 <MemberSignature Language="C#" Value="public Mono.Unix.UnixDirectoryInfo RootDirectory { get; }" />
351 <MemberSignature Language="ILAsm" Value=".property instance class Mono.Unix.UnixDirectoryInfo RootDirectory" />
352 <MemberType>Property</MemberType>
354 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
355 <AssemblyVersion>2.0.0.0</AssemblyVersion>
356 <AssemblyVersion>4.0.0.0</AssemblyVersion>
359 <ReturnType>Mono.Unix.UnixDirectoryInfo</ReturnType>
362 <summary>Gets information about the mount point directory.</summary>
364 A <see cref="T:Mono.Unix.UnixDirectoryInfo" /> instance containing
365 information about the mount point directory.
369 <altmember cref="F:Mono.Unix.Native.Fstab.fs_file" />
372 <Member MemberName="ToString">
373 <MemberSignature Language="C#" Value="public override string ToString ();" />
374 <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string ToString() cil managed" />
375 <MemberType>Method</MemberType>
377 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
378 <AssemblyVersion>2.0.0.0</AssemblyVersion>
379 <AssemblyVersion>4.0.0.0</AssemblyVersion>
382 <ReturnType>System.String</ReturnType>
386 <summary>To be added.</summary>
387 <returns>To be added.</returns>
388 <remarks>To be added.</remarks>
391 <Member MemberName="TotalFreeSpace">
392 <MemberSignature Language="C#" Value="public long TotalFreeSpace { get; }" />
393 <MemberSignature Language="ILAsm" Value=".property instance int64 TotalFreeSpace" />
394 <MemberType>Property</MemberType>
396 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
397 <AssemblyVersion>2.0.0.0</AssemblyVersion>
398 <AssemblyVersion>4.0.0.0</AssemblyVersion>
401 <ReturnType>System.Int64</ReturnType>
404 <summary>Gets the total free space on the volume.</summary>
406 A <see cref="T:System.Int64" /> containing the total free space on
411 The total free space includes all the free space on the Unix
412 volume, and may include space the normal users are not able to
413 write to, either because of disk quotas or because space is
414 reserved for the super-user (<c>root</c>).
417 Use <see cref="P:Mono.Unix.UnixDriveInfo.AvailableFreeSpace" /> for
418 the available free space, excluding space reserved for the
422 <exception cref="T:System.InvalidOperationException">
423 There was an error retrieving the total free space.
424 The volume may not be mounted.
428 <Member MemberName="TotalSize">
429 <MemberSignature Language="C#" Value="public long TotalSize { get; }" />
430 <MemberSignature Language="ILAsm" Value=".property instance int64 TotalSize" />
431 <MemberType>Property</MemberType>
433 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
434 <AssemblyVersion>2.0.0.0</AssemblyVersion>
435 <AssemblyVersion>4.0.0.0</AssemblyVersion>
438 <ReturnType>System.Int64</ReturnType>
441 <summary>Gets the total size of the Unix volume.</summary>
443 A <see cref="T:System.Int64" /> containing the total size of the
448 <exception cref="T:System.InvalidOperationException">
449 There was an error retrieving the total size.
450 The volume may not be mounted.
454 <Member MemberName="VolumeLabel">
455 <MemberSignature Language="C#" Value="public string VolumeLabel { get; }" />
456 <MemberSignature Language="ILAsm" Value=".property instance string VolumeLabel" />
457 <MemberType>Property</MemberType>
459 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
460 <AssemblyVersion>2.0.0.0</AssemblyVersion>
461 <AssemblyVersion>4.0.0.0</AssemblyVersion>
464 <ReturnType>System.String</ReturnType>
467 <summary>Gets the block device name.</summary>
469 A <see cref="T:System.String" /> containing the block device for
474 <altmember cref="F:Mono.Unix.Native.Fstab.fs_spec" />