Win: add Crystal::System::DirHandle#4903
Conversation
|
Alright, so in the other PR it is decided to keep How are we feeling about efficiency of these abstractions? A class wrapping a class that ultimately just stores a pointer doesn't seem right. |
| raise Errno.new("Unable to create directory '#{path}'") | ||
| end | ||
| Crystal::System::DirHandle.mkdir(path, mode) | ||
| 0 |
There was a problem hiding this comment.
Not exactly related to this pr, but why does ˋmkdirˋ & ˋrmdirˋ returns ˋ0ˋ?
There was a problem hiding this comment.
I don't know, but in spec there is
Dir.mkdir(path, 0o700).should eq(0)
There was a problem hiding this comment.
Probably they should be marked as : Nil for avoid leaking a useless return value
There was a problem hiding this comment.
I'll make another PR for it
|
I suppose, |
|
No no no, a subclass cannot work, that'll leak to documentation and other such details. You're saying it cannot be a struct (perhaps only ideologically, because technically mutable structs are fine) but I think for these internal objects we have to make an exception and think about them as an inherent part of the public objects. Make it a struct to keep efficiency at a sane level. Though I just argued in IRC that we could easily do without |
|
Why can't the methods that change between operating systems be implemented directly in |
|
Yes, |
This reverts commit 038e7ec. revert the previous commit
|
This now superseeded by #5447 |
|
#5447 was merged, closing this |
Moved platform specific things from
DirtoCrystal::System::DirHandleYou can find
winapi.crandwinerrorin this PR #4832