Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8088064

Enhance Launcher to Support Long File Names

XMLWordPrintable

    • Verified

      For example in FilePath.cpp:

      TString FilePath::FixPathForPlatform(const TString FileName) {
             TString result = FileName;
             size_t position = result(_T("\\?\""));

              if (position == TString::npos) {
                  result = TString(_T("\\?\"")) + result;
              }

              return result;
      }

      bool FilePath::DeleteFile(const TString FileName) {
          bool result = false;

          if (FileExists(FileName) == true) {
      #ifdef WINDOWS
              // To extend to long filenames prepend \\?\" to the filename.
              TString lFileName = FixPathForPlatform (FileName);
              FileAttributes attributes(lFileName);

              if (attributes.Contains(faReadOnly) == true) {
                  attributes.Remove(faReadOnly);
              }

              result = ::DeleteFile(lFileName.data()) == TRUE;
      #endif //WINDOWS
      #ifdef POSIX
              if (unlink(StringToFileSystemString(FileName)) == 0) {
                  result = true;
              }
      #endif //POSIX
          }

          return result;
      }

            vdrozdov Victor Drozdov (Inactive)
            cbensen Chris Bensen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: