Re: Why do people need to back up their memory on a SD card?



On Fri, 03 Aug 2007 03:08:40 -0500:

Like the title says, Why do people need to back up their memory on a
SD card? Can someone please tell me what imporant files they would
need to back up to avoid having it erased?

No more need than backing up a computer,
if the files on it (user programs, data, formulas, text)
have no importance to you, and are disposable.

Also, is there any document that explains how to back this up
onto a SD card?

PUSH :3:BK001 ARCHIVE

The stored file contains everything in your HOME (VAR) directory
(and subdirectories), including any user key assignments, alarms,
and even flags (if you did PUSH before ARCHIVE).

In case the occasion ever arises to restore:

:3:BK001 RESTORE
(this concludes with an automatic "warmstart,"
after which a POP command will restore flags, too,
if you had originally done PUSH as above.

I've already learned how to format the card, access it from
my HP 50g and take it out and insert it into my PC. I stored a simple
"HI" message on one of the free variables and I tried to transfer it
to my PC. However, the message turned up to be something like,
"HPHP49, e..." Btw, I opened this up in Microsoft Word.. haha.
How can I transfer word document files from my PC to Calc
and vice versa?

Do you have Microsoft Word in your calculator?

Then those calculator strings aren't "Word documents,"
but just plain text strings ("Notepad" strings,
although you can open plain strings in other programs too).

Everything is stored exactly as if you'd done a cable transfer
to a computer, in "binary" mode, which means that you always get
an 8-byte "file type identifying" prefix "HPHP49-x"
(sort of like the "%PDF-1.4[cr]" which begins all PDF files),
followed by the *binary* internal content of the calculator object.

In the case of "string" objects, there are exactly five more
bytes after "HPHP49-x" which are not part of the actual string,
and then the rest of the file is the actual string.

So you could open in Notepad, delete the inserted leading characters,
then save -- I suppose it would be handy to have a little command
or utility program on the computer to do this automatically,
should anyone be inclined to create one (in Unix you could
use a simple "dd" or "tail" command and skip the first 13 bytes).

From computer to calculator, just store *plain*text* on the card
(not in MS-Word native format, not Unicode, just plain ANSI text!);
the calculator will retrieve the entire file as a string object.

The computer uses "CRLF" at the end of lines;
the calc shows the "CR" character as a "black" dot,
because it's like Unix/Linux and needs only the "LF" character.

To remove all the "CR" characters from any string on the stack:

\<< 13 CHR "" SREPL DROP \>> 'RMCR' STO

Cable transfer software includes a "text" transfer mode which already
takes care of some of the above, using extra software in the calc,
but SD card STO/RCL is always like "binary" cable transfer,
and needs just a dash of seasoning to bring out the full flavor :)

[r->] [OFF]
.



Relevant Pages

  • Re: built-in file copy chews my files
    ... i can see that this doesn't actually benefit the calculator system directly ... You evidently mean, when you copy *computer* files to the SD card, ... an arbitrary computer file is stored in the calculator ... The string is the exact image, bit for bit, of the computer file, ...
    (comp.sys.hp48)
  • Re: built-in file copy chews my files
    ... You evidently mean, when you copy *computer* files to the SD card, ... outside of the calculator environment. ... an arbitrary computer file is stored in the calculator ... The string is the exact image, bit for bit, of the computer file, ...
    (comp.sys.hp48)
  • Re: 50g questions, programming and OS
    ... The calculator can always read a card file literally ... (as a string), but can not store that same string back, ...
    (comp.sys.hp48)
  • Re: How about UserRPL command to store "bare" text to SD?
    ... after you've popped your SD card into your computer reader, ... This will leave you with the "headerless" string by itself, ... if the editor reserves "null" characters for its own use. ... are already directly importable to the calculator as strings; ...
    (comp.sys.hp48)
  • Ascii Import/Export for SD card and Emulator
    ... and the same situation when using an emulator. ... when you put the source text files on an SD card ... as a string on the stack, waiting for translation help, ... isn't UserRPL. ...
    (comp.sys.hp48)

Loading