Merged
Conversation
The System.console + reflection method of getting the console encoding is unreliable, since if stdio has been connected to a pipe the System.console will be null, causing us to fall back on an incorrect console encoding. This adds logic to first try the sun.stdout.encoding property, which is populated using the same Win32 GetConsoleCP function as the Console encoding. This property if present should allow us to always get the proper encoding for the console, regardless of whether stdio is a pipe or the actual console.
NIO allows us to specify more options than the java.io APIs (specifically FileInput/OutputStream and RandomAccessFile) which makes more flags and combinations thereof work well when opening files using JDK-only features. Examples: * The Windows FILE_SHARE_DELETE flag is provided via extended flags on Windows and can be supported using NIO file-open logic. * Append mode for non-readable channels can be handled by NIO rather than us wrapping the file in a second channel. Note that read + write + append triggers an error in the NIO logic, so we must still wrap for that case. * File truncation can be done during file open using NIO logic. We still fall back on a no-truncation version to handle pipes and fifos, which may duplicate some pre-check logic.
* Properly negotiate encoding of entries whereever returned. * Add win32 logic for Dir.home with username (only returns a result for the login user). * Unify some redundant entry-walking logic. * Raise EEXIST for existing files and dirs in Dir.mkdir. These fixes may help other platforms with unusual filesystem encodings too.
Member
Author
|
The specs are now running to completion (for the "fast" subset, anyway) with around 150 failures and errors. The failures are largely in areas we expect: process launching, low-level IO operations, and a large number from win32ole which does not appear to boot properly for these specs. I will merge what I have here since rake and mspec are working. Once #6340 lands we can revisit the failing specs and get a tagged run going. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a WIP to get specs running green on Windows.