*

Welcome, Guest. Please login or register.

Get your own OLPC - Buy an XO laptop on eBay!
Pages: [1]
Print
Author Topic: Saving docs to SD card  (Read 5871 times)

Saving docs to SD card

wolf9545
Contributor
*
Posts: 52


March 02, 2008, 05:59:50 AM

Sorry if this is in the wrong category.

I notice that while on my XO if I go to a website and view a pdf file and the go to the journal and copy it to the SD card it is un-readable on a standard pc.  On my pc I can see the pdf file but if I go to open it, acrobat says that there is some error with the pdf file.  Does anyone know if this is going to be fixed in update 1?
Logged

#1 Re: Saving docs to SD card

olpc_franco
Master Contributor
***
Posts: 484



March 21, 2008, 03:57:02 PM

This isn't a defect, but a nice to have capability, and it may be included in an update if enough people ask for it, I suppose.  The target kids will not generally be porting files between their XO and their desktops/laptops.

But here is how it is done for the Browser Activity.

When you click on a pdf file on the internet, it saves it to the Journal.  But the Journal is a unique Sugar Activity that saves it under a filename unuseable outside of the XO.  If you drag it from Journal to the SD or USB drive and then port it to your PC or MAC, it can't be read.

So first find the file in the XO:

Go to Journal and it should be right at or near the top.

Drag it to your SD card.
Open the Terminal Activity.  If you open it when you start browsing, you will be ready for the rest.
Go to the SD card in Terminal: cd /media/<name of your SD card>
Check the name: ls
You should see a name that starts with the word file like this example:

File pc558.pdf downloaded from....etc.

That is not a nice linux file name so you will change it.

cp *.pdf file.pdf

and you will copy the long filename to a smaller one called file.pdf (or whatever you want to name it.

Put the SD card in your other computer and you should be able to read the file with Acrobat.

WARNING:

Read the following, if, when you move the SD card you lose the file.

I have hot-swapped SD cards and USB devices many times without losing a file.  I did not want to be bothered pulling the SD card so I moved file.pdf to my new 8GB USB drive.  I pulled the drive and when I inserted the USB drive in my PC, the pdf file was gone.

So I redid the operation and I noticed that the SD card showed in the Journal but not the USB drive.  However the USB drive showed up in /media. 

In Terminal I copied the file.pdf again.  You would then return to Jounal and unmount the drive.  If your drive does not show in Journal when you plug it back in, then read on.

I decided to nicely unmount my USB drive.  Since it didn't show in Journal where it could be unmounted with a click, I went back to Terminal and typed:

mount

and that gave me all the mounted drives.  My 8GB usb showed as /dev/sdb.
So I unmounted it with the command:

umount /dev/sdb   [NOT unmount, but umount]

I pulled it and put it in the PC and Adobe opened file.pdf just fine.

When I plugged the recalcitrant 8GB drive back, it mounted automatically and still had my file.pdf.

Franco




find / -name *pc558* 2>/dev/null
Logged

If I suggest it, I have tested it on my XO.

#2 Re: Saving docs to SD card

fyoder
Senior Contributor
**
Posts: 100



WWW
March 21, 2008, 04:43:32 PM

nice instructions, though

Quote
cp *.pdf file.pdf

would fail if there were more than one file with the pdf extension.  The shell would interpret it as a request to copy the files to a directory called file.pdf.  In that case you would have to type the full name of the file, or some some unique portion, say if there was only one file that began with the characters pc you could cp pc* file.pdf
Logged

Loose lips lose spit.

#3 Re: Saving docs to SD card

olpc_franco
Master Contributor
***
Posts: 484



March 21, 2008, 05:09:37 PM


Quote
cp *.pdf file.pdf

would fail if there were more than one file with the pdf extension.  The shell would interpret it as a request to copy the files to a directory called file.pdf.  In that case you would have to type the full name of the file, or some some unique portion, say if there was only one file that began with the characters pc you could cp pc* file.pdf

 Grin Grin Yes, I assumed that a person fooling around with linux would know that.  But, of course, they may not, so thanks for pointing that out for those just getting their feet wet in Terminal.

« Last Edit: March 21, 2008, 05:12:50 PM by olpc_franco » Logged

If I suggest it, I have tested it on my XO.

#4 Re: Saving docs to SD card

joncamfield
Contributor
*
Posts: 49


WWW
April 09, 2008, 11:06:10 AM

Here's a related question; say I have a handful of files on an USB stick I want to copy to my SD card -- more than I want to go through the journal open -> copy to ->return process with.  so I go to the terminal and do a cp /media/USB/file*.ext /media/card/ -- is there a trick/script/etc. to run to have Sugar/Journal re-index my card to notice those files?  It re-indexes on mount, (i.e.  unmounting it and re-inserting it works) so there must be something?  Is the answer those .py scripts to move files in and out of the journal?
Logged
Pages: [1]
Print
Jump to:  

Members
Total Members: 2406
Latest: sembik
Stats
Total Posts: 31943
Total Topics: 3843
Online Today: 36
Online Ever: 238
(April 18, 2011, 09:48:50 PM)
Users Online
Users: 0
Guests: 20
Total: 20