{"action":"opened","issue":{"url":"https://api.github.com/repos/OpenCobolIDE/OpenCobolIDE/issues/168","labels_url":"https://api.github.com/repos/OpenCobolIDE/OpenCobolIDE/issues/168/labels{/name}","comments_url":"https://api.github.com/repos/OpenCobolIDE/OpenCobolIDE/issues/168/comments","events_url":"https://api.github.com/repos/OpenCobolIDE/OpenCobolIDE/issues/168/events","html_url":"https://github.com/OpenCobolIDE/OpenCobolIDE/issues/168","id":85033623,"number":168,"title":"[Bug] Temporary files should be created at temporary dir","user":{"login":"GitMensch","id":6699539,"avatar_url":"https://avatars.githubusercontent.com/u/6699539?v=3","gravatar_id":"","url":"https://api.github.com/users/GitMensch","html_url":"https://github.com/GitMensch","followers_url":"https://api.github.com/users/GitMensch/followers","following_url":"https://api.github.com/users/GitMensch/following{/other_user}","gists_url":"https://api.github.com/users/GitMensch/gists{/gist_id}","starred_url":"https://api.github.com/users/GitMensch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GitMensch/subscriptions","organizations_url":"https://api.github.com/users/GitMensch/orgs","repos_url":"https://api.github.com/users/GitMensch/repos","events_url":"https://api.github.com/users/GitMensch/events{/privacy}","received_events_url":"https://api.github.com/users/GitMensch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-04T10:39:03Z","updated_at":"2015-06-04T10:39:03Z","closed_at":null,"body":"Reasons:\r\n* maybe not possible to create them at the current file path (as seen below)\r\n* if access is granted and something goes wrong you have temporary files that likely stay in a non temporary folder\r\n\r\n```log\r\nERROR::pyqode.backend::something went bad with worker <function lint at 0x034C10C0>(data={'path': 'C:\\\\TEST.COB', 'code': [removed from log], 'encoding': 'cp1252'})\r\nERROR::pyqode.backend::Traceback (most recent call last):\r\nERROR::pyqode.backend::  File \"c:\\dev\\pyqode.core\\pyqode\\core\\backend\\server.py\", line 135, in _handle\r\nERROR::pyqode.backend::  File \"C:\\Dev\\OpenCobolIDE\\open_cobol_ide\\linter.py\", line 33, in lint\r\nERROR::pyqode.backend::PermissionError: [Errno 13] Permission denied: 'C:\\\\.oci1433411286.cbl'\r\n```\r\n\r\nThis is what cobc/libcob does (pseudocode):\r\n\r\n```c\r\nif !(tmpdir = getenv (\"TMPDIR\")) {\r\n#ifdef\t_WIN32\r\n   if (tmpdir = !getenv (\"TEMP\"))\r\n      if !(tmpdir = getenv (\"TMP\"))\r\n         if !(tmpdir = getenv (\"USERPROFILE\"))\r\n            tmpdir = .;\r\n#else\r\n   if (tmpdir = !getenv (\"TMP\"))\r\n      if !(tmpdir = getenv (\"TEMP\"))\r\n         tmpdir = /tmp;\r\n#endif\r\n\r\n   setenv(\"TMPDIR\", tmpdir);\r\n}\r\n```\r\n\r\nFor supporting relative paths to copybooks it should be enough to pass an additional -I $fullpath_of_current_file to the compiler\r\n\r\n## System information\r\n\r\n\r\n- OpenCobolIDE: 4.6.2\r\n- Python: 3.4.3 (32bits)\r\n- Qt: 5.4.1\r\n- PyQt: 5.4.1\r\n- pyqode.core: 2.7.0.dev2\r\n- pyqode.cobol: 2.6.1\r\n- pyqode.qt: 2.6.0\r\n- pygments: 2.0.2\r\n\r\n"}}