{
  "id": 305347,
  "title": "How to preserve files in the working directory? (I'm having trouble)",
  "url": "/competitions/tensorflow-great-barrier-reef/discussion/305347",
  "author_name": "Mel",
  "post_date": "2022-02-04T22:12:36.573000",
  "votes": 1,
  "comment_count": 2,
  "views": 0,
  "content": "<p>You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save &amp; Run All\"</p>\n<p>I want to save data in my working directory and have done the following:</p>\n<ul>\n<li>Clicked \"Save Version\"</li>\n<li>MAde sure \" Save and Run All (Commit) is ticked</li>\n<li>In \"Advanced Settings\" made sure \"Always save output\" is selected\"</li>\n</ul>\n<p>When I look at the result in the Viewer and click \"Data\" I see all the images I saved to te working directory as expected.  I then click \"Edit\" but the images are no longer there and I need to \"Run All\" to see the images in the working directory again. </p>\n<p>I doesn't seem right to need to \"Run All\" every time.  What can I do?</p>\n<p>Thank you.</p>",
  "messages": [
    {
      "id": 1676507,
      "postDate": "2022-02-05T04:09:13.070Z",
      "content": "<p>You can zip the data and create a link to it using IPython. Something like this.</p>\n<pre><code>from IPython.display import FileLink\n\nshutil.make_archive('images', 'zip', '/kaggle/working/images')\nFileLink(r'images.zip')\n</code></pre>",
      "rawMarkdown": "You can zip the data and create a link to it using IPython. Something like this.\n\n```\nfrom IPython.display import FileLink\n\nshutil.make_archive('images', 'zip', '/kaggle/working/images')\nFileLink(r'images.zip')\n```",
      "votes": 1
    },
    {
      "id": 1676331,
      "postDate": "2022-02-04T22:12:36.573Z",
      "content": "<p>You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save &amp; Run All\"</p>\n<p>I want to save data in my working directory and have done the following:</p>\n<ul>\n<li>Clicked \"Save Version\"</li>\n<li>MAde sure \" Save and Run All (Commit) is ticked</li>\n<li>In \"Advanced Settings\" made sure \"Always save output\" is selected\"</li>\n</ul>\n<p>When I look at the result in the Viewer and click \"Data\" I see all the images I saved to te working directory as expected.  I then click \"Edit\" but the images are no longer there and I need to \"Run All\" to see the images in the working directory again. </p>\n<p>I doesn't seem right to need to \"Run All\" every time.  What can I do?</p>\n<p>Thank you.</p>",
      "rawMarkdown": "You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\"\n\nI want to save data in my working directory and have done the following:\n- Clicked \"Save Version\"\n- MAde sure \" Save and Run All (Commit) is ticked\n- In \"Advanced Settings\" made sure \"Always save output\" is selected\"\n\nWhen I look at the result in the Viewer and click \"Data\" I see all the images I saved to te working directory as expected.  I then click \"Edit\" but the images are no longer there and I need to \"Run All\" to see the images in the working directory again. \n\nI doesn't seem right to need to \"Run All\" every time.  What can I do?\n\nThank you.\n\n",
      "votes": 1
    },
    {
      "id": 1676353,
      "postDate": "2022-02-04T23:03:38.140Z",
      "rawMarkdown": "",
      "votes": 1,
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 1676507,
      "author_name": "David Roberts",
      "author_url": "",
      "post_date": "2022-02-05T04:09:13.070000",
      "content": "<p>You can zip the data and create a link to it using IPython. Something like this.</p>\n<pre><code>from IPython.display import FileLink\n\nshutil.make_archive('images', 'zip', '/kaggle/working/images')\nFileLink(r'images.zip')\n</code></pre>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1676353,
      "author_name": "",
      "author_url": "",
      "post_date": "2022-02-04T23:03:38.140000",
      "content": "",
      "votes": 1,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1676507": "You can zip the data and create a link to it using IPython. Something like this.\n\n```\nfrom IPython.display import FileLink\n\nshutil.make_archive('images', 'zip', '/kaggle/working/images')\nFileLink(r'images.zip')\n```",
    "1676331": "You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\"\n\nI want to save data in my working directory and have done the following:\n- Clicked \"Save Version\"\n- MAde sure \" Save and Run All (Commit) is ticked\n- In \"Advanced Settings\" made sure \"Always save output\" is selected\"\n\nWhen I look at the result in the Viewer and click \"Data\" I see all the images I saved to te working directory as expected.  I then click \"Edit\" but the images are no longer there and I need to \"Run All\" to see the images in the working directory again. \n\nI doesn't seem right to need to \"Run All\" every time.  What can I do?\n\nThank you.\n\n",
    "1676353": ""
  }
}