Skip to content

Can't write history on irb exit on Windows #1219

Description

@imbrish

On my Windows machine, as of ruby 3.4.9 irb 1.14.3, the irb can no longer write history on exit and shows the following warning:

Can't write history to "..." due to insufficient permissions.

I can write manually into the same history file from within irb just fine. The "problem" seems to be caused by the changes in 52307f9. I first suspected history_file.chmod 0o600 failing on Windows, but it is actually history_file.dirname.writable? that returns false, despite I am able to write files from irb into my user profile directory just fine.

Saving history worked correctly in ruby 3.3.11 irb 1.13.1, probably because it simply did not have the directory writable check back then.

The .writable? check seems to work correctly for other directories but returns false for the user profile in both ruby versions. I am not sure why, I checked the permissions and they look fine. As mentioned, the actual files can be written without any problems.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions