On 25 Feb., 17:09, "gadaleta.marco" <[email protected]> wrote:
> How i can parse a binary file?

This is not a Gears question.  Gears does not provide you with a way
to access files, neither locally nor remotely.

> For example i want retrive sql statement from resource.txt file.

The normal way: Access "resource.txt" with AJAX - so as if it resides
on the server.  You need a server-URL for this, which must conform to
the "same origin philiosphy" (except for cross-domain-workers, which
can access a different domain, but let's leave that out for the
moment).

If you want to have a file locally stored by gears, "resource.txt"
must be included in the manifest file so it is automatically retrieved
from the server.
Well, yes, you can create some "fake resource.txt" file such, that it
appears to come from the server but it is not really there (see the
Gears doc on how to create such files in the LocalStore).  So Gears is
able to create "virtual URLs on the server" which are not really on
the server but are served locally.  (This can be used to create images
on the fly, or - most time - to prepare content to be uploaded to the
server.)
But there is no big difference with Gears than thinking without
Gears.  The only difference is, that Gears "sees" a file on the
"offlined server", which for real is needs not to be there for real.
But you can emulate that without gears by just putting the file on the
HTTP-server.

So all access to any resources the browser does MUST BE DONE THE SAME
WAY as if it is a resource on the server.  So I'm afraid, your
question has nothing to do with Gears.  Probably you are looking at
the wrong location.

> There' s a way??

Perhaps there is another misunderstanding.  Gears does not add SQL
support to the browser.  Gears just uses a local SQL database to store
information permanently.  However it is NOT possible to execute SQL
against this database.  Only Gears does this internally but it does
not expose the SQL interface to JavaScript.
So please think of Gears as nothing more than a local page cache.
(Well, there is a little bit more as it allows access to the location
API etc., but that's a minimal thing, which - AGAIN - can be seen like
accessing a resource on a server which is aware of your location
somehow.)

So you usually CANNOT DO MORE than you already can do without Gears in
online mode.
The only thing Gears adds is to allow to write a Javascript driven
application which also works offline.
But Gears does not give this application more access rights than any
other web application without Gears.

> thank you

HTH
-Tino

Reply via email to