Add File internals that work directly with Path#2869
Conversation
9ffc75b to
da8093e
Compare
|
Ensure the change made is tested in the CIs |
a48ea71 to
c91d3f6
Compare
harendra-kumar
left a comment
There was a problem hiding this comment.
Change the module names as follows:
FileSystem.Windows.File => FileSystem.File.Window
FileSystem.Posix.File => FileSystem.File.Posix
537706c to
67fedf7
Compare
01121cf to
6394f06
Compare
73fc760 to
c348768
Compare
06e0c7e to
9771953
Compare
| , writeAppendArray | ||
| , writeAppendChunks | ||
|
|
||
| -- * Deprecated |
There was a problem hiding this comment.
You can remove this section, as this is a new module.
There was a problem hiding this comment.
I though it will be easier to replace the module if we keep them. But we can remove it too, because if someone is anyway making changes then they can change this as well.
| name2 :: FileMode -> FileMode; \ | ||
| name2 (FileMode mode) = FileMode (x .|. mode) | ||
|
|
||
| {- |
There was a problem hiding this comment.
Why did you comment this out?
So you can avoid using ##?
There was a problem hiding this comment.
No, we are using the definitions directly from the header files rather than defining ourselves. I kept this code commented, just in case there is any issue in using the headers directly.
There was a problem hiding this comment.
Does commenting out CPP definitions even work?
There was a problem hiding this comment.
But if it did not error out because you've not used ## it likely works as expected.
There was a problem hiding this comment.
This code is actually commented, it does not work in any way.
| name1 :: FileMode -> FileMode; \ | ||
| name1 (FileMode mode) = FileMode (x .|. mode); \ | ||
| {-# INLINE name2 #-}; \ | ||
| name2 :: FileMode -> FileMode; \ | ||
| name2 (FileMode mode) = FileMode (x .|. mode) |
There was a problem hiding this comment.
Why do name1 and name2 have the same implementations?
set and clear have the same implementation?
Should name2 be something like x .&. complement mode instead?
There was a problem hiding this comment.
Yes, that's a bug. copy, paste and forgot to fix.
adithyaov
left a comment
There was a problem hiding this comment.
I've reviewed the PR. I've added some comments.
9771953 to
0e6f897
Compare
Use asCWStringUnsafe to create a null terminated C string in windows module. Export openFile functions directly from the platform specific module and reverse the dependency on Utils module.
Now we can set and clear open flags and create mode using function based API.
0e6f897 to
c3cb522
Compare
No description provided.