{"action":"created","issue":{"url":"https://api.github.com/repos/godotengine/godot/issues/4464","repository_url":"https://api.github.com/repos/godotengine/godot","labels_url":"https://api.github.com/repos/godotengine/godot/issues/4464/labels{/name}","comments_url":"https://api.github.com/repos/godotengine/godot/issues/4464/comments","events_url":"https://api.github.com/repos/godotengine/godot/issues/4464/events","html_url":"https://github.com/godotengine/godot/issues/4464","id":151483902,"number":4464,"title":"Creating directories broke!","user":{"login":"OlexiyKravchuk","id":10380658,"avatar_url":"https://avatars.githubusercontent.com/u/10380658?v=3","gravatar_id":"","url":"https://api.github.com/users/OlexiyKravchuk","html_url":"https://github.com/OlexiyKravchuk","followers_url":"https://api.github.com/users/OlexiyKravchuk/followers","following_url":"https://api.github.com/users/OlexiyKravchuk/following{/other_user}","gists_url":"https://api.github.com/users/OlexiyKravchuk/gists{/gist_id}","starred_url":"https://api.github.com/users/OlexiyKravchuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlexiyKravchuk/subscriptions","organizations_url":"https://api.github.com/users/OlexiyKravchuk/orgs","repos_url":"https://api.github.com/users/OlexiyKravchuk/repos","events_url":"https://api.github.com/users/OlexiyKravchuk/events{/privacy}","received_events_url":"https://api.github.com/users/OlexiyKravchuk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-27T20:33:15Z","updated_at":"2016-04-28T12:01:57Z","closed_at":"2016-04-28T11:56:31Z","body":"Creating directories broke!\r\nI discovered that someone had broken a very good thing that worked perfectly before.\r\n\r\nEarlier I commonly when saving new files, simply specify a desired path, and if it did not exist, then all the required directory created automatically to any depth and saves the file with the specified name. like this... in 1.1 stable\r\n```\r\nfunc seve_file():\r\n\tFILE_PATH = \"res://SAVED_DATA/new_NONEXISTENT_directory/test/test.txt\"\r\n\tFILE = File.new()\r\n\t\r\n\tif (FILE.file_exists(FILE_PATH) == false && VOX_FILE.is_open() == false):\r\n\t\tFILE.open(FILE_PATH, File.WRITE)\r\n\t\tFILE.store_string(\"string_12345678\")\r\n\t\tFILE.close()\r\n```\r\n\r\nbut now when I tried to save a file in a directory that previously did not exist, I was suddenly was refused and I had to rewrite the old code which previously worked fine using a single string, and create a whole monster which added all a bunch of blocks in which it was necessary to rewrite each directory selected call options to create the directory manually, and this shit for automation ...\r\nin 2.0.1 stable\r\n```\r\nfunc seve_file():\r\n\tvar dir = Directory.new()\r\n\tdir.make_dir(\"res://SAVED_DATA/new_NONEXISTENT_directory\")\r\n\tdir.make_dir(\"res://SAVED_DATA/new_NONEXISTENT_directory/test\")\r\n\t\r\n\tFILE_PATH = \"res://SAVED_DATA/new_NONEXISTENT_directory/test/test.txt\"\r\n\tFILE = File.new()\r\n\t\r\n\tif (FILE.file_exists(FILE_PATH) == false && VOX_FILE.is_open() == false):\r\n\t\tFILE.open(FILE_PATH, File.WRITE)\r\n\t\tFILE.store_string(\"string_12345678\")\r\n\t\tFILE.close()\r\n```\r\n\r\nsimply return how it worked before, it was perfect!!!\r\n"},"comment":{"url":"https://api.github.com/repos/godotengine/godot/issues/comments/215402330","html_url":"https://github.com/godotengine/godot/issues/4464#issuecomment-215402330","issue_url":"https://api.github.com/repos/godotengine/godot/issues/4464","id":215402330,"user":{"login":"akien-mga","id":4701338,"avatar_url":"https://avatars.githubusercontent.com/u/4701338?v=3","gravatar_id":"","url":"https://api.github.com/users/akien-mga","html_url":"https://github.com/akien-mga","followers_url":"https://api.github.com/users/akien-mga/followers","following_url":"https://api.github.com/users/akien-mga/following{/other_user}","gists_url":"https://api.github.com/users/akien-mga/gists{/gist_id}","starred_url":"https://api.github.com/users/akien-mga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akien-mga/subscriptions","organizations_url":"https://api.github.com/users/akien-mga/orgs","repos_url":"https://api.github.com/users/akien-mga/repos","events_url":"https://api.github.com/users/akien-mga/events{/privacy}","received_events_url":"https://api.github.com/users/akien-mga/received_events","type":"User","site_admin":false},"created_at":"2016-04-28T12:01:57Z","updated_at":"2016-04-28T12:01:57Z","body":"Don't worry, I don't think anyone was hurt :)\r\n\r\nAbout the bug itself, I think the behaviour in 2.0.x is what it should be. Creating files and creating directories are different operations, so it's normal that you need to create the directories manually when they're missing, trying to opening a non-existing file should not create all the directories that would lead to it, it should just throw an error."}}