Client side forced disk writes

C

Csaba Gabor

I'd like to be able to force a local disk write with javascript (so
that another instance of the browser detects it).

I'm in an linux environment with a common file system and about 50
workstations. Latest and greatest of many browsers (eg. Chromium, FF,
Opera). I'd like to be able to log into two workstations under the
same id, run the same (or even different) browsers on the same .htm
file I'd be writing such that when one of the browser instances writes
some data (to the disk) the other one is able to pick it up.

Near as I can tell, most of the browsers I've tested with have a lock
file so that I can't actually execute two instances from distinct
workstations at the same time. But even if that were not the case,
the obvious candidate, cookies, are cached in the browser and not
written to disk till browser exit. The other obvious candidate,
localStorage, seems to behave similarly, though I've not tested it so
extensively.

Does anyone see a way to accomplish this? There is no server involved
at this point (I know how to do this given a server), the .htm files
are local on the desktop. Also, is there a way to avoid the lock
restriction the browsers complain of under my scenario?

Thanks,
Csaba Gabor from Vienna
 
D

Denis McMahon

I'd like to be able to force a local disk write with javascript (so
that another instance of the browser detects it).

Does javascript allow for local (client side) storage? I know you can
implement it eg using ms activex in ie, but as I understand it, such
inter-process communication breaks the javascript security model, so it
shouldn't be possible (microsoft breaking it aside).

Rgds

Denis McMahon
 
M

Michael Haufe (\TNO\)

I'd like to be able to force a local disk write with javascript (so
that another instance of the browser detects it).

I'm in an linux environment with a common file system and about 50
workstations.  Latest and greatest of many browsers (eg. Chromium, FF,
Opera).  I'd like to be able to log into two workstations under the
same id, run the same (or even different) browsers on the same .htm
file I'd be writing such that when one of the browser instances writes
some data (to the disk) the other one is able to pick it up.

Near as I can tell, most of the browsers I've tested with have a lock
file so that I can't actually execute two instances from distinct
workstations at the same time.  But even if that were not the case,
the obvious candidate, cookies, are cached in the browser and not
written to disk till browser exit.  The other obvious candidate,
localStorage, seems to behave similarly, though I've not tested it so
extensively.

Does anyone see a way to accomplish this?  There is no server involved
at this point (I know how to do this given a server), the .htm files
are local on the desktop.  Also, is there a way to avoid the lock
restriction the browsers complain of under my scenario?

Thanks,
Csaba Gabor from Vienna

Outside of LocalStorage and the like, I believe you'd have to use
something like XULRunner or Adobe Air as they are the only other html
runtimes that have access to the disk on a Linux machine.
 
B

Bart Van der Donck

Michael said:
Outside of LocalStorage and the like, I believe you'd have to use
something like XULRunner or Adobe Air as they are the only other html
runtimes that have access to the disk on a Linux machine.

In Flash you have the FileReference API; I'm not sure if it would
qualify.

IMHO the only robust solution is to use Apache on the Linux box so you
have your default CGI/PHP environment. Or why not SSI:

set: <!--#exec cmd="echo 'mydata' > file.txt" -->
get: <!--#include file="file.txt" -->
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top