[GHC] #13489: openTempFile fails when the template parameter contain a path separator

#13489: openTempFile fails when the template parameter contain a path separator -------------------------------------+------------------------------------- Reporter: harendra | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: | Version: 8.0.1 libraries/base | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Poor/confusing Unknown/Multiple | error message Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- If the template string contains a path separator, for example "a/b" then openTempFile just fails with a message which does not even indicate what the problem might be. It displays the following message: {{{ mod: /tmp/: openTempFile: does not exist (No such file or directory) }}} It can either provide a better error message, saying that path separator is not allowed or if it is legal to allow a path separator then it should create that path in the temp dir. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13489 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13489: openTempFile fails when the template parameter contain a path separator -------------------------------------+------------------------------------- Reporter: harendra | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): I don't think we want to create any directories in `openTempFile`. Afterall, it would then be unclear whether the user should cleanup the parent directories or just the file. Consequently, I think the right solution here is to simply disallow path separators in the template: if the user wants to specify a directory component then they can provide it in the first argument. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13489#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13489: openTempFile fails when the template parameter contain a path separator -------------------------------------+------------------------------------- Reporter: harendra | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by harendra): I agree, that sounds like the right solution. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13489#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13489: openTempFile fails when the template parameter contain a path separator
-------------------------------------+-------------------------------------
Reporter: harendra | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: libraries/base | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Poor/confusing | Unknown/Multiple
error message | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#13489: openTempFile fails when the template parameter contain a path separator -------------------------------------+------------------------------------- Reporter: harendra | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.2.1 Component: libraries/base | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => merge * milestone: => 8.2.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13489#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13489: openTempFile fails when the template parameter contain a path separator -------------------------------------+------------------------------------- Reporter: harendra | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: libraries/base | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.2` as 02a9c6a3442c1b560176ec01789c0042c655c0eb. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13489#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC