You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/05/01 01:33:00 UTC

[jira] [Work logged] (IO-768) Add reserved Windows file names CONIN$ and CONOUT$ to FileSystem

     [ https://issues.apache.org/jira/browse/IO-768?focusedWorklogId=764720&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-764720 ]

ASF GitHub Bot logged work on IO-768:
-------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/May/22 01:32
            Start Date: 01/May/22 01:32
    Worklog Time Spent: 10m 
      Work Description: Marcono1234 commented on code in PR #355:
URL: https://github.com/apache/commons-io/pull/355#discussion_r862411792


##########
src/main/java/org/apache/commons/io/FileSystem.java:
##########
@@ -73,6 +73,8 @@ public enum FileSystem {
      *
      * @see <a href="https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file">Naming Conventions
      *      (microsoft.com)</a>
+     * @see <a href="https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea#consoles">

Review Comment:
   Is this link useful or is it too technical? The problem is that the above linked "Naming Files, Paths, and Namespaces" does not mention `CONIN$` and `CONOUT$`.



##########
src/test/java/org/apache/commons/io/FileSystemTest.java:
##########
@@ -82,6 +85,14 @@ public void testSorted() {
                 assertTrue(chars[i] < chars[i + 1], fs.name());
             }
         }
+
+        for (final FileSystem fs : FileSystem.values()) {

Review Comment:
   Have added this for consistency; however it is already implicitly checked that the array is sorted by the methods `testIsLegalName` and `testIsReservedFileName` because they would fail if the array was not sorted.





Issue Time Tracking
-------------------

            Worklog Id:     (was: 764720)
    Remaining Estimate: 0h
            Time Spent: 10m

> Add reserved Windows file names CONIN$ and CONOUT$ to FileSystem
> ----------------------------------------------------------------
>
>                 Key: IO-768
>                 URL: https://issues.apache.org/jira/browse/IO-768
>             Project: Commons IO
>          Issue Type: Improvement
>    Affects Versions: 2.11.0
>            Reporter: Marcono1234
>            Priority: Minor
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The file names {{CONIN$}} and {{CONOUT$}} are also reserved on Windows, see https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea#consoles.
> Example code:
> {code}
> jshell> Files.readString(Path.of("CONIN$"))
> |  Exception java.io.IOException: Incorrect function
> ...
> {code}
> It would be good to add them to {{org.apache.commons.io.FileSystem}}.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)