8000 Updated FileAttributes for Linux and macOS (#2297) · shdvr/dotnet-api-docs@7005d91 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7005d91

Browse files
author
Ron Petrusha
authored
Updated FileAttributes for Linux and macOS (dotnet#2297)
* Updated for Linux and macOS * Added blank line. Co-Authored-By: rpetrusha <ronpet@microsoft.com>
1 parent 9da4fa5 commit 7005d91

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

xml/System.IO/FileAttributes.xml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,32 @@
4747
<format type="text/markdown"><![CDATA[
4848
4949
## Remarks
50-
You can get attributes for files and directories by calling the <xref:System.IO.File.GetAttributes%2A> method, and you can set them by calling the <xref:System.IO.File.SetAttributes%2A> method.
50+
You can get attributes for files and directories by calling the <xref:System.IO.File.GetAttributes%2A?displayProperty=nameWithType> method, and you can set them by calling the <xref:System.IO.File.SetAttributes%2A?displayProperty=nameWithType> method.
5151
52-
It is not possible to change the compression status of a <xref:System.IO.File> object by using the <xref:System.IO.File.SetAttributes%2A> method. Instead, you must actually compress the file using either a compression tool or one of the classes in the <xref:System.IO.Compression?displayProperty=nameWithType> namespace.
53-
54-
52+
It is not possible to change the compression status of a <xref:System.IO.File> object by using the <xref:System.IO.File.SetAttributes%2A?displayProperty=nameWithType> method. Instead, you must actually compress the file using either a compression tool or one of the classes in the <xref:System.IO.Compression?displayProperty=nameWithType> namespace.
5553
54+
The following attributes are not supported by .NET Core on Linux and macOS:
55+
56+
- <xref:System.IO.FileAttributes.Archive?displayProperty=nameWithType>
57+
- <xref:System.IO.FileAttributes.Compressed?displayProperty=nameWithType>
58+
- <xref:System.IO.FileAttributes.Device?displayProperty=nameWithType>
59+
- <xref:System.IO.FileAttributes.Encrypted?displayProperty=nameWithType>
60+
- <xref:System.IO.FileAttributes.IntegrityStream?displayProperty=nameWithType>
61+
- <xref:System.IO.FileAttributes.NoScrubData?displayProperty=nameWithType>
62+
- <xref:System.IO.FileAttributes.NotContentIndexed?displayProperty=nameWithType>
63+
- <xref:System.IO.FileAttributes.Offline?displayProperty=nameWithType>
64+
- <xref:System.IO.FileAttributes.SparseFile?displayProperty=nameWithType>
65+
- <xref:System.IO.FileAttributes.System?displayProperty=nameWithType>
66+
- <xref:System.IO.FileAttributes.Temporary?displayProperty=nameWithType>
67+
68+
On Unix systems, the value returned by <xref:System.IO.File.GetAttributes%2A?displayProperty=nameWithType> includes `Hidden` for a file whose name begins with a period ("."). On macOS, you can get or set the hidden flag.
69+
5670
## Examples
5771
The following example shows how to retrieve the attributes for a file and check if the file is read-only.
5872
5973
[!code-csharp[System.IO.FileAttributes#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.io.fileattributes/cs/example.cs#1)]
60-
[!code-vb[System.IO.FileAttributes#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.io.fileattributes/vb/example.vb#1)]
61-
74+
[!code-vb[System.IO.FileAttributes#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.io.fileattributes/vb/example.vb#1)]
75+
6276
]]></format>
6377
</remarks>
6478
<altmember cref="M:System.IO.File.GetAttributes(System.String)" />
@@ -214,7 +228,7 @@
214228
</ReturnValue>
215229
<MemberValue>16</MemberValue>
216230
<Docs>
217-
<summary>The file is a directory.</summary>
231+
<summary>The file is a directory. <see langword="Directory" /> is supported on Windows, Linux, and macOS.</summary>
218232
</Docs>
219233
</Member>
220234
<Member MemberName="Encrypted">
@@ -290,7 +304,7 @@
290304
</ReturnValue>
291305
<MemberValue>2</MemberValue>
292306
<Docs>
293-
<summary>The file is hidden, and thus is not included in an ordinary directory listing.</summary>
307+
<summary>The file is hidden, and thus is not included in an ordinary directory listing. <see langword="Hidden" /> is supported on Windows, Linux, and macOS.</summary>
294308
</Docs>
295309
</Member>
296310
<Member MemberName="IntegrityStream">
@@ -369,7 +383,7 @@
369383
</ReturnValue>
370384
<MemberValue>128</MemberValue>
371385
<Docs>
372-
<summary>The file is a standard file that has no special attributes. This attribute is valid only if it is used alone.</summary>
386+
<summary>The file is a standard file that has no special attributes. This attribute is valid only if it is used alone. <see langword="Normal" /> is supported on Windows, Linux, and macOS.</summary>
373387
</Docs>
374388
</Member>
375389
<Member MemberName="NoScrubData">
@@ -524,7 +538,7 @@
524538
</ReturnValue>
525539
<MemberValue>1</MemberValue>
526540
<Docs>
527-
<summary>The file is read-only.</summary>
541+
<summary>The file is read-only. <see langword="ReadOnly" /> is supported on Windows, Linux, and macOS. On Linux and macOS, changing the <see langword="ReadOnly" /> flag is a permissions operation.</summary>
528542
</Docs>
529543
</Member>
530544
<Member MemberName="ReparsePoint">
@@ -562,7 +576,7 @@
562576
</ReturnValue>
563577
<MemberValue>1024</MemberValue>
564578
<Docs>
565-
<summary>The file contains a reparse point, which is a block of user-defined data associated with a file or a directory.</summary>
579+
<summary>The file contains a reparse point, which is a block of user-defined data associated with a file or a directory. <see langword="ReparsePoint" /> is supported on Windows, Linux, and macOS. </summary>
566580
</Docs>
567581
</Member>
568582
<Member MemberName="SparseFile">

0 commit comments

Comments
 (0)
0