Mac os uploading problem

since mbed is web based and online i tried it on a macbook
compiled fine but saving it to the pokitto results into temporarly bricking it

im suspecting the the filesystem is dumbing invisible data ( dot files, like spotlight and similar )

2 Likes

*menacing glance at .DS_Store*

1 Like

looking at potential fix with terminal commands
current fix

rm /Volumes/CRP\ DISABLD/firmware.bin
cp /your/game.bin /Volumes/CRP\ DISABLD/
```

this?

1 Like

yeaa but you cant ask users to install 30 day trail software

ill just spin this in a little app file where they drag and drop the bin on too

Thereā€™s a couple of commands part way down.

Prevent MDS from attempting to Index
sudo touch /Volumes/your volume name here/.metadata_never_index

Disable Indexing AND Searching of Volumes
sudo mdutil -i off -d /Volumes/your volume name here

Delete existing Spotlight Index
sudo rm -rfv /.Spotlight-V100

Disable creating ā€˜.ds_storeā€™ on USB volumes
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true

Disable creating ā€˜.ds_storeā€™ on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

Sorry if this makes your machine explode, implode, hack NORAD, ā€œFriendsā€ you with Justin Bieber or any other unexpected results.

And further down:

Using the commands:

defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
sudo mdutil -i off -d /Volumes

no more .ds_store and no more ā€œ.example.jpgā€ when I copy ā€œexample.jpgā€ from mac to usb.

Even If I keep viewing hidden files with the command

defaults write com.apple.finder AppleShowAllFiles YES

no more .ds_store on Desktop, and no more on any folders.

so, thank you again I do NOT see .ds_store anymore, and best without using any external software.

1 Like

this isnā€™t a good solution for peoples machines if they donā€™t know what there doing, especially with APFS thats going to need all that stuff to convert file systems on the os itself

Itā€™s either that or running a bunch of cleanup scripts afterwards, either manually or if thereā€™s possibly some way to automate them. Truth be told I donā€™t know what Macs use for scripting, Iā€™ve only used one twice.

Ultimately this is more Apple/Macā€™s fault than the Pokittoā€™s fault, it affects all USB devices that identify as a file system. I donā€™t know if thereā€™s a way to make the Pokitto refuse to create any of Macā€™s typical side-effect files, but that would come at a price as does every feature.

Really unless thereā€™s a free open-source solution available or something less invasive, this is never going to be a user-friendly issue to solve, but as I say, itā€™s not the Pokittoā€™s fault, itā€™s a long-standing problem with OS Xā€™s approach to managing files.

A brief search lead me to this ā€˜donationwareā€™ (i.e. free but theyā€™d like a donation if possible) program called folderwasher that looks pretty decent.

same problems with other mbed devices. in fact, because pokitto is a ā€œdumbā€ flash drive, it is one of the few that can be made to work. many others cant

what we really need is a browser plugin that registers .bin mime type and does the copying terminal-style

1 Like

Dunno if that would work but itā€™s probably worth a shot.
For the online IDE at least, a browser plugin seems like the way to go.

(Iā€™d offer to have a go, but I think most browsers use Javascript and Iā€™m not exactly Javascriptā€™s biggest fan (quite the opposite). The most Iā€™ve ever done is written an image slider (technically re-written, I took one someone else wrote and cleaned it up to make it more extensible and readable).)

ok im trying to write an application right now to open the existing file and rewriting the contents with the source file

i tried but volumes seem to be protected by the os so i can delete files by a program

the current fix i got is
cp game.bin /Volumes/CRP\ DISABLD/firmware.bin
in terminal
at least a mac user cant brick the device, but its a bit annoying to have to do it via the terminal

Canā€™t you store that as script file and then just double click it?

In Windows you could just write a .bat file and then double click it to make it run, Iā€™m sure Linux and OS X must have a similar feature.

Failing that you could make an executable in C.
Or if your computer has Lua installed and accessible from the terminal, use a Lua script (Iā€™m sure there must be a way to set those up to be executable via double-click).

well yea a shell script but you have to chmod u+x it first
also game.bin in the is just an example of your binary file
since you have to cd to it first or just drag the file on the terminal

tried to do it in c but accessing a Volumes needs root access :S

You arenā€™t admin/root?
Is it a shared computer?

Odd that accessing a USB would need higher priveledges.

On Windows dragging a file onto a .bat is the same as executing the .bat with the fileā€™s full path as an argument, perhaps OS X has something similar?

best i got so far is this

name it pokitto.command file and it its double clickable

#!/bin/sh
echo "drag .bin file and press enter"
read BIN
cp $BIN /Volumes/CRP\ DISABLD/firmware.bin
diskutil unmount /Volumes/CRP\ DISABLD

yes also unmounting the volume cuz mac os complains wen removing usb drives without doing that

5 Likes

Thanks for the batch, Iā€™ll try this tonight. Until now I used the terminal to copy the bin manually :sweat:

I do similiar thing for Windows just for fun. I know itā€™s not needed.
name it pokitto.bat

@echo off
SET BIN=%1
IF NOT "%BIN%"=="" goto copy
:getbin
echo "drag .bin file and press enter"
SET /P BIN=
:copy
FOR /F "tokens=2 usebackq delims==" %%i IN (`wmic volume where "Label='CRP DISABLD'" get DriveLetter /format:list`) DO set DEST=%%i
cp -f %BIN% %DEST%/firmware.bin
mountvol %DEST% /p

You can directly drop bin file to bat or open bat and drop bin file to cmd screen and press enter.

3 Likes

Iā€™m surprised to see WMIC in use.

I only know about WMI because I had to use it during a serial transmission experiment I did a while back, I havenā€™t seen it used much.

1 Like

I donā€™t know much about batch scripting. I just found WMIC solution on internet :smile:

2 Likes