Mac os uploading problem

*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

its not a batch its a shell script, again the . command if for mac the .bat is for windows

and if someone figures out how to write a browser plugin for Firefox and/or chrome they might be able to trigger these scripts