[GHC] #8342: System.Directory.getPermissions does not work well on Windows 7

#8342: System.Directory.getPermissions does not work well on Windows 7 ---------------------------------------+--------------------------------- Reporter: freizl | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries/directory | Version: 7.4.1 Keywords: | Operating System: Windows Architecture: x86_64 (amd64) | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ---------------------------------------+--------------------------------- It works well for following code {{{ System.Directory.getPermissions "/path/to/somewhere" }}} However getting error with this: {{{ System.Directory.getPermissions "/path/to/somewhere/" *** Exception: getPermissions: does not exist (No such file or directory) }}} The only difference is the path name. It gets error when having extra trailing slash. It looks wired. Thanks your help. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8342 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8342: System.Directory.getPermissions does not work well on Windows 7 ----------------------------------------+---------------------------------- Reporter: freizl | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries/directory | Version: 7.4.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by leroux): A quick, hacky fix would be to remove any trailing slashes... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8342#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8342: System.Directory.getPermissions does not work well on Windows 7 ----------------------------------------+---------------------------------- Reporter: freizl | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries/directory | Version: 7.4.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by freizl): Replying to [comment:1 leroux]:
A quick, hacky fix would be to remove any trailing slashes...
Yes, I did that in my project. However I'm wondering the reason and hopefully there will be a fix. ;) Thanks. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8342#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8342: System.Directory.getPermissions does not work well on Windows 7 ----------------------------------------+---------------------------------- Reporter: freizl | Owner: leroux Type: bug | Status: new Priority: normal | Milestone: Component: libraries/directory | Version: 7.4.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ----------------------------------------+---------------------------------- Changes (by leroux): * owner: => leroux Comment: Replying to [comment:2 freizl]:
Yes, I did that in my project. However I'm wondering the reason and hopefully there will be a fix. ;) Thanks.
I'll try to take a look tonight. Luckily, I have a windows box I can test on. I'm thinking that this is mainly just a problem how windows handles paths. https://github.com/ghc/packages- directory/blob/master/System/Directory.hs#L194 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8342#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8342: System.Directory.getPermissions does not work well on Windows 7 ----------------------------------------+---------------------------------- Reporter: freizl | Owner: leroux Type: bug | Status: new Priority: normal | Milestone: Component: libraries/directory | Version: 7.4.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ----------------------------------------+---------------------------------- Comment (by leroux): It seems like keeping a trailing slash is an user error (in terms of Windows). Someone let me know if I'm wrong. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8342#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8342: System.Directory.getPermissions does not work well on Windows 7 -------------------------------------+------------------------------------- Reporter: freizl | Owner: leroux Type: bug | Status: new Priority: normal | Milestone: Component: Core | Version: 7.4.1 Libraries | Keywords: Resolution: | Architecture: x86_64 (amd64) Operating System: Windows | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by gintas): * cc: core-libraries-committee@… (added) Comment: How about being strict and always disallowing slashes at the end? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8342#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8342: System.Directory.getPermissions does not work well on Windows 7 -------------------------------------+------------------------------------- Reporter: freizl | Owner: leroux Type: bug | Status: new Priority: normal | Milestone: Component: Core | Version: 7.4.1 Libraries | Keywords: Resolution: | Architecture: x86_64 (amd64) Operating System: Windows | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by freizl): I think library user just like it works well without error or meaningful error. "Does not exists" make little sense IMHO. Being strict is good idea and I suppose core library would do either of below when has slash at the end - Fixed it auto hence getPermissions show result correctly. - Display errors like "shall no have slash at the end" Suggestions/comments? Thanks. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8342#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8342: System.Directory.getPermissions does not work well on Windows 7 -------------------------------------+------------------------------------- Reporter: freizl | Owner: leroux Type: bug | Status: new Priority: normal | Milestone: Component: Core | Version: 7.4.1 Libraries | Keywords: Resolution: | Architecture: x86_64 (amd64) Operating System: Windows | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by hvr): If this turns out to be an issue in `directory`, please file an issue at upstream https://github.com/haskell/directory/issues and change this ticket's state to "Upstream" -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8342#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8342: System.Directory.getPermissions does not work well on Windows 7 -------------------------------------+------------------------------------- Reporter: freizl | Owner: leroux Type: bug | Status: new Priority: normal | Milestone: Component: Core | Version: 7.4.1 Libraries | Keywords: Resolution: | Architecture: x86_64 (amd64) Operating System: Windows | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by ekmett): I'd think we'd want `directory` to just do the right thing and normalize before handing it off to the OS on windows. All the other platforms deal gracefully with trailing slashes. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8342#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8342: System.Directory.getPermissions does not work well on Windows 7 -------------------------------------+------------------------------------- Reporter: freizl | Owner: leroux Type: bug | Status: upstream Priority: normal | Milestone: Component: Core | Version: 7.4.1 Libraries | Keywords: Resolution: | Architecture: x86_64 (amd64) Operating System: Windows | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by freizl): * status: new => upstream -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8342#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8342: System.Directory.getPermissions does not work well on Windows 7 -------------------------------------+------------------------------------- Reporter: freizl | Owner: leroux Type: bug | Status: upstream Priority: normal | Milestone: Component: Core | Version: 7.4.1 Libraries | Keywords: Resolution: | Architecture: x86_64 (amd64) Operating System: Windows | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by freizl): Open new ticket to "directory" lib. https://github.com/haskell/directory/issues/9 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8342#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8342: System.Directory.getPermissions does not work well on Windows 7 -------------------------------------+------------------------------------- Reporter: freizl | Owner: leroux Type: bug | Status: closed Priority: normal | Milestone: Component: Core Libraries | Version: 7.4.1 Resolution: fixed | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: None/Unknown | (amd64) Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by Rufflewind): * status: upstream => closed * resolution: => fixed Comment: Fixed upstream. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8342#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC