castor
  1. castor
  2. CASTOR-644

unable to create a file called Con.java on Windows

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9.5.2, 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5
    • Fix Version/s: 1.1 M1
    • Component/s: XML code generator
    • Labels:
      None
    • Environment:
      Operating System: Windows 2000
      Platform: PC
    • Bugzilla Id:
      1505
    • Number of attachments :
      1

      Description

      By chance, I have a schema which results in SourceGenerator trying to create a
      file called Con.java. This does not work on Windows, I assume because it is too
      similar to "con", as in "copy con <file>". It's OK on Unix.

      The SourceGenerator just catches the exception and says "unable to create file:
      Con.java".

      Maybe something slightly more useful would be nice that mentions that it is a
      reserved name for Windows?

        Activity

        Hide
        Keith Visco added a comment -

        Wow, that's very strange, I never knew that limitation on windows before. I
        actually did a simple test and I can't create any files with the name con.*
        where * could be any extension, not just .java (of course .java is the only
        importance here).

        We'll try to add an explaination for this in the FAQ, seems like a windows bug
        to me however.

        Show
        Keith Visco added a comment - Wow, that's very strange, I never knew that limitation on windows before. I actually did a simple test and I can't create any files with the name con.* where * could be any extension, not just .java (of course .java is the only importance here). We'll try to add an explaination for this in the FAQ, seems like a windows bug to me however.
        Hide
        Werner Guttmann added a comment -

        Funny enough, this is actually still the case with 1.0.4-SNAPSHOT. And I cannot find any references to this in the XML FAQ either ... .

        Show
        Werner Guttmann added a comment - Funny enough, this is actually still the case with 1.0.4-SNAPSHOT. And I cannot find any references to this in the XML FAQ either ... .
        Hide
        Edward Kuns added a comment -

        In Windows explorer, if I try to create D:\con.txt I get the complaint "A file with the name you specified already exists. Specify a different file name." This is definitely an issue in Windows. If I try to rename a folder to "con" the attempt is totally ignored. If I try to create a file named "con.asdfklasdlfajsldkfadsf" I get the same complaint that a file already exists with that name.

        Show
        Edward Kuns added a comment - In Windows explorer, if I try to create D:\con.txt I get the complaint "A file with the name you specified already exists. Specify a different file name." This is definitely an issue in Windows. If I try to rename a folder to "con" the attempt is totally ignored. If I try to create a file named "con.asdfklasdlfajsldkfadsf" I get the same complaint that a file already exists with that name.
        Hide
        Werner Guttmann added a comment -

        Time to point this out in the FAQ, I think .. . In addition, as we introduce proper exception handling, this will be easier to spot in the future. In addition, I think the error message should make things a little bit clearer.

        Show
        Werner Guttmann added a comment - Time to point this out in the FAQ, I think .. . In addition, as we introduce proper exception handling, this will be easier to spot in the future. In addition, I think the error message should make things a little bit clearer.
        Hide
        Edward Kuns added a comment -

        I've updated JNaming and SingleClassGenerator to warn about the reserved names under Windows. Currently the code will warn only. With this update, the need to update documentation is less strong.

        Show
        Edward Kuns added a comment - I've updated JNaming and SingleClassGenerator to warn about the reserved names under Windows. Currently the code will warn only. With this update, the need to update documentation is less strong.
        Hide
        Edward Kuns added a comment -

        Change commited without a new CTF test case. The test case will require a new feature to the CTF. Also, for now the code warns under all OSes and fails under none. We might want to change this. If so, we can create another subissue of this issue.

        Since we are doing work on the name clash infrastructure right now, actually, the final decision on what to do with this warning can be decided there.

        Show
        Edward Kuns added a comment - Change commited without a new CTF test case. The test case will require a new feature to the CTF. Also, for now the code warns under all OSes and fails under none. We might want to change this. If so, we can create another subissue of this issue. Since we are doing work on the name clash infrastructure right now, actually, the final decision on what to do with this warning can be decided there.

          People

          • Assignee:
            Edward Kuns
            Reporter:
            Adrian Smith
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: