Summary
file-type does not work on Windows
Metadata
- Id: f123cd78d642ccc08267a653485b7a6167f6fe38
- Trac id: 607
- Type: defect
- Reporter: zbigniew
- Owner: felix
- Cc:
- Status: closed
- Component: core libraries
- Estimated difficulty:
- Resolution: fixed
- Priority: major
- Milestone: 4.9.0
- Version: 4.7.x
- Changetime: 2012-09-24 21:47:48 UTC
- Created: 2011-06-15 08:01:52 UTC
- Keywords:
Attachments
- f123cd78d642ccc08267a653485b7a6167f6fe38/attachments/0001-Fix-posix-file-type-on-Windows-by-testing-for-regula.patch
Description
Because unknown file types like S_IFLNK are defined to S_IFREG on Windows, file-type will always report symbolic-link for regular files (and regular-file? will return #f).
Attached patch tests for S_IFREG first, fixing the problem. FYI, applying with "git am filename.patch" will propagate authorship credit.
Alternative solution: define S_IFLNK etc. to 0. Slightly more dangerous but all platforms should have no zero file type flags. posix-extras currently uses this method.
Changes and comments
[2011-06-15 08:02:17 UTC] zbigniew attached 0001-Fix-posix-file-type-on-Windows-by-testing-for-regula.patch (description=#f)
[2011-06-18 13:18:56 UTC] felix changed status from new to closed
[2011-06-18 13:18:56 UTC] felix set resolution to fixed
[2011-06-18 13:18:56 UTC] felix wrote:
Thanks very much, patch applied.
[2012-09-24 21:47:48 UTC] felix changed milestone from 4.8.0 to 4.9.0
[2012-09-24 21:47:48 UTC] felix wrote:
Milestone 4.8.0 deleted