Skip to content

MacOS Python File Manipulation Issue - Transfer, in-situ editing and deleting files. #31

@alanp-sporelab

Description

@alanp-sporelab

Overview

macOS (tested with 10.15.1) appears to have hidden behaviour when moving files onto mass storage devices (e.g. Degu Sensor Units) via normal copy, paste and deleting UI commands.

Setup

  • Degu sensor unit with main.py containing default MicroPython code
  • Unit plugged into Mac, accessible as USB mass storage device.

Issue

Multiple related issues observed:

  1. MacOS has non-obvious deleting behaviour. If attempting to delete a file on a Degu Sensor Unit presented as a mass storage device, the deleted files will be moved to a hidden folder called .Trashes. Attempting to delete files directly within this folder yields no results. Only current solution appears to be to empty system ‘bin’, which then deletes files in .Trashes folder on the Degu Sensor Unit as well.
  2. Try to edit main.py (using Atom editor), replacing default code with BMP280 example code via simple cut and paste fails to save all file contents, saving only ~half of file contents. Fixed by creating main.py externally, then moving it onto the Degu Sensor Unit via command line (which leads into issue below).
  3. OS has appears to have hidden behaviour when moving files onto mass storage devices via normal copy and paste UI commands. After having deleted main.py (as above, including clearing macOS 'bin'), observed main.py file being unable to be copy and pasted onto Degu Sensor Unit.
  • OS throws an error saying there isn’t enough space on the device.
  • main.py contains BMP280 example code, reported at ~7045 bytes
  • Degu Sensor Unit purportedly has 11KB available, but copying fails.
  • Repeating the process using cp command on the terminal succeeds however.

Suggestion

Given that the above is OS level behaviour, suggested solution is to explicitly call out / mention the system behaviour to users in an FAQ / in tutorials.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions