<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Faisal,<br>
<br>
<i><b> You can download or save a file to a particular location and
then change the self._jobject.file_path variable (as the Read activity
does).<br>
<br>
</b></i>The Read activity only does the self.jobject.file_path variable
when receiving a shared document. I wish I had a really old version of
Read Etexts to show you. Unfortunately, by the time I got my git
repository I already had the sharing code in there. But basically you
don't need to do anything special to do a write_file() that doesn't
write a file. You just need a Journal entry that exists and has a MIME
type. Then you have an Activity that can resume any Journal entry with
that MIME type. The core Read activity doesn't make PDFs. It just
reads them. Then, when it closes down write_file() it saves the
current page number as metadata. No file is saved.<br>
<br>
self._jobject has nothing to do with it.<br>
<br>
Activities that only read Journal entries are a bit unusual. I know a
bit about them because I've written two (Read Etexts and View Slides).
And there are occasions when you need to write a file. You cannot
create a Journmal entry without writing a file. Even in the Read
activity if you press the Save button on the Edit toolbar you'll get an
error because Read is being asked to create a new Journal entry and it
has no code to do this.<br>
<br>
As for using a file to store meta data, I'm not pushing it as a best
practice, but a practical expedient until metadata starts working
better. Several Activities already do this. In your Music activity I
would save an empty file and use metadata, as you suggest. Eventually
that file would be replaced with one that had music in it. In an
adventure game program I would save all the state information in a
file, and could easily put other kinds of meta data in there too.<br>
<br>
James Simmons<br>
</body>
</html>