Added fallback behavior to 'readDirStreamWithType'
* Changed the assignment of values for missing DT_* constants. Since the 'd_type' field is of type 'unsigned char' we assign a negative number for each missing DT_* constant so they are distinguishable but do not collide with the values from the libc implementation. * Added a new 'DirStreamWithPath' that contains the path of the directory the directory stream belongs to. * 'readDirStreamWithType' falls back to a 'stat' if the 'd_type' is unknown or undetermined. * Added some tests for 'readDirStreamWithType'.
Showing
- System/Posix/Directory.hsc 18 additions, 6 deletionsSystem/Posix/Directory.hsc
- System/Posix/Directory/ByteString.hsc 18 additions, 6 deletionsSystem/Posix/Directory/ByteString.hsc
- System/Posix/Directory/Common.hsc 44 additions, 3 deletionsSystem/Posix/Directory/Common.hsc
- System/Posix/Directory/PosixPath.hsc 18 additions, 7 deletionsSystem/Posix/Directory/PosixPath.hsc
- configure.ac 34 additions, 2 deletionsconfigure.ac
- tests/ReadDirStream.hs 23 additions, 0 deletionstests/ReadDirStream.hs
Loading
Please register or sign in to comment