Page 1 of 1
read and write the local disk from a revlet
Posted: Sun Mar 21, 2010 12:33 pm
by jmburnod
Hi All,
i need to read and write the local disk from a revlet
I select this option in the standalone setting
With revStudio i get the path of the stack and i build
a local folder path for read and write data
It work fine in a stack. glapilemaitre is a valid path
But not from a revlet, glapilemaitre = the short name of the stack
Code: Select all
on openstack
global glapilemaitre
put the long name of this stack into glapilemaitre
delete word 1 of glapilemaitre
delete char 1 of glapilemaitre
delete last char of glapilemaitre
end openstack
What i forget ?
Jean-Marc
Re: read and write the local disk from a revlet
Posted: Sun Mar 21, 2010 3:30 pm
by FourthWorld
Is it absolutely necessary to write to the user's hard drive from the browser? Is there any way you could consider using remote storage for that as is more common on the web?
I've seen a surprising number of Revlets that request access to my local hard drive, and that can be fine for intranets but for the general public it may just scare people away from your Revlet or even the Rev plugin itself for the reasons I noted in the revJournal blog:
http://revjournal.com/blog.irv?pid=1262632837.378884
If you're in that rare circumstance in which you truly need to work with the site visitor's local hard drive, you may do better to use "ask file" to determine where the user wants to save the data. As I noted in another blog entry, Revlet stacks have no path because they exist only in memory, which is why your method of obtaining the path fails:
http://revjournal.com/blog.irv?pid=1253992718.569667
On your local disk it works fine because there actually is a stack file, but in a browser what the user has is a copy in memory of the file loaded from your server.
Re: read and write the local disk from a revlet
Posted: Mon Mar 22, 2010 10:04 am
by jmburnod
Thank for explanation and link
I need to write on hard disk to allow user save text or paint.
At this moment i build a painting tool for child with special needs there can't
use a dialogbox
Jean-Marc
Re: read and write the local disk from a revlet
Posted: Mon Mar 22, 2010 11:40 am
by FourthWorld
For children it may be hard for them to find files within their hard drive -- any harm in writing it to the desktop?
If that'll work you can use the specialFolderPath function:
export snapshot from img 1 to file (specialFolderPath("desktop")&"/MyImage.jpg") as jpeg
Re: read and write the local disk from a revlet
Posted: Tue Mar 23, 2010 9:52 am
by jmburnod
Hi FourthWorld,
Code: Select all
any harm in writing it to the desktop?
Yes, the revlet have a users registry and each user have a folder for text, paint
The preferences navigation mode can be different :
• one contact for a navigation by scrolling objects
• two contactors they send a keyboard message "9" = GoNextObject and "b" to confirm the selection
The navigation modes are like in "heure de pointe/ParkLot" : arrowkeyRight = GoNextObject and "b" confirm the selection
Thank one more for help
Jean-Marc
Re: read and write the local disk from a revlet
Posted: Tue Mar 23, 2010 1:09 pm
by FourthWorld
Are you the one who made the Parking Lot game? Nice work - I've spent some good time with it.
If the users have a pre-arranged path, what challenge is involved in determining that path for the write?
Re: read and write the local disk from a revlet
Posted: Tue Mar 23, 2010 2:49 pm
by jmburnod
Code: Select all
Are you the one who made the Parking Lot game? Nice work - I've spent some good time with it.
If the users have a pre-arranged path, what challenge is involved in determining that path for the write?
Yes i made the Parking Lot game. If you are Richard Gaskin, you sent me a feed-back. Thank one more
The challenge is one folder with on subfolder for each users
Jean-Marc
Re: read and write the local disk from a revlet
Posted: Tue Mar 23, 2010 4:39 pm
by FourthWorld
jmburnod wrote:Yes i made the Parking Lot game. If you are Richard Gaskin, you sent me a feed-back. Thank one more
The challenge is one folder with on subfolder for each users
Yep - I'm Richard. It seems signatures have recently been disabled here, which is a major drag since mine contains my contact info. You're welcome to write me at
ambassador@fourthworld.com
On the user folders, do you expect to have multiple users accessing your site from one computer? Because of course if you support multiple computers and need to store info that can be shared with all of them you'll want to store that info on the server so everyone can access it.
Re: read and write the local disk from a revlet
Posted: Tue Apr 06, 2010 2:13 am
by Ron Zellner
OK, you've tweaked my interest, where can I see the Parking Lot game?
Re: read and write the local disk from a revlet
Posted: Tue Apr 06, 2010 10:30 am
by jmburnod
Hi Ron,
You can read a small documentation here :
http://alternatic.ch/spip.php?article72
("Park lot" is "heure de pointe" in french)
It is a version for handicaped people with one or two contactors
but you can play with the mouse also without interface for special needs
Or dowload a standalone at :
Mac OSX version (2.7 Mo) :
http://alternatic.ch/jmb/hdposx.zip
Windows version (1.4 Mo) :
http://alternatic.ch/jmb/hdpwindows.zip
Regards
Jean-Marc