Scolring - Forum

Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology

Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered

You are not logged in.

#26 8-Dec-2014 22:15:56

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

iri wrote:

You can not list files and directories in the user partition (see the 4th post in this thread) if the cache is activated.

So this applies to all vms on a specific machine?

Offline

#27 8-Dec-2014 23:31:55

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,023
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

Yes.

You can open / read a file from the user partition if the cache is activated (with a open dialog box by example). You can not list them to create a list yourself.

Offline

#28 9-Dec-2014 00:22:32

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

iri wrote:

Yes.

You can open / read a file from the user partition if the cache is activated (with a open dialog box by example). You can not list them to create a list yourself.

I see thx.

Offline

#29 11-Dec-2014 17:00:48

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

iri wrote:

You may build a web interface (in JS by example) to select a project. It's just an idea.

I'm just getting back to this....so using the webnavigator, javascript running in the page can be used to navigate the user to (or back to) the user partition, once the cache has been actviated, and i would use web page elements to create the file selection interface...is that what you mean (meant, it's been a while)

-h

Offline

#30 11-Dec-2014 18:01:50

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,023
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

Yes, I thought about it

Offline

#31 11-Dec-2014 20:22:52

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

iri wrote:

Yes, I thought about it

thx iri!
great! my old o'reilly javascript book will once again prove its usefulness.
on the downside, i always used javascript to interact with activex objects, i've never done a project where it is dynamically building objects in the document, but it shouldn't be too hard.

Offline

#32 12-Dec-2014 14:28:26

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

oh well I did a lot of looking yesterday to see if Javascript running in chrome can access the file system. It can't. So I will have to think of the strategy of building a list of XOS fileswhen the user is using. Os3d.

Or create a scol utility that can acess the user partition to build a list when the cache is deactivated.

Or perhaps write a "plugin" for the editor (a .pkg that creates a  button for the user to press that will scan the user partition and create the list. (Perhaps this last method is best since it will mean less apps to run.)

Perhaps java in chrome can do this (probably not but I will look into it.)

Last edited by hebdemnobad (12-Dec-2014 14:29:38)

Offline

#33 12-Dec-2014 15:04:18

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 4,461
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

why not just provide the window file dialog box ? this return a P type so you can load a file from anywhere with this even with cache activated.
this is the user who select the file.

Offline

#34 12-Dec-2014 15:16:31

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

I

arkeon wrote:

why not just provide the window file dialog box ? this return a P type so you can load a file from anywhere with this even with cache activated.
this is the user who select the file.

Its hard to use with fingers, especially thumbs.

Offline

#35 12-Dec-2014 15:23:38

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,023
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

Well ... As i already said you, i don't really know JS.

Is it not possible with jQuery / jQuery.ajax ? https://api.jquery.com/jQuery.ajax/

Also maybe with FileReader : http://www.javascripture.com/FileReader

Here is an example, except on IE (i'm not the author) :

<script type="text/javascript">
window.onload = function() {
	var f = document.getElementById('file'),
		res = document.getElementById('result');
	f.onchange = function() {
		var file = f.files[0],
			fr = new FileReader();
			
		fr.onprogress = function() {
			res.innerHTML = 'Loading...';
		};
		fr.onerror = function() {
			res.innerHTML = 'Oops, an error occurs ...';
		};
		fr.onload = function() {
			res.innerHTML = '';
			res.appendChild(document.createTextNode(fr.result));
		};
		
		fr.readAsText(file);
	};
};
</script>

<label for="file">Select a text file</label>
<input type="file" id="file" />

<pre id="result"></pre>

On gecko browser (Firefox ...) and XUL ('Readfile') : http://xulfr.org/wiki/RessourcesLibs/readFile

On IE and JS : http://msdn.microsoft.com/en-us//librar … 85%29.aspx

Maybe this can help you

Offline

#36 12-Dec-2014 16:03:45

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

thx irir, the problem though is that example uses a form input button, which opens up the os file dialog, so that doesn't get around the problem (since you still have to selected a file which may be very small, using your thumb.

from what i have read, all browsers sandbox javascript's access to the file system, much in the same way as scol.

Offline

#37 12-Dec-2014 17:31:16

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 4,461
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

you could launch an another vm with no cache activation and then the first vm ask in network messages to list the files and receive the list.

ho just checked in code : if ((Firstpack==Cachepack) && (strncmp(shortbuf,"public/",7)) && (strcmp(shortbuf,"public")))
so you can list files in the public directory of the classic partition

so if you make the user projects in a public directory you will be able to list them.

Offline

#38 12-Dec-2014 17:34:08

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 4,461
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

just another idea ^^
what about the drag and drop for touch devices ?

Offline

#39 12-Dec-2014 19:28:26

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

arkeon wrote:

you could launch an another vm with no cache activation and then the first vm ask in network messages to list the files and receive the list.

ho just checked in code : if ((Firstpack==Cachepack) && (strncmp(shortbuf,"public/",7)) && (strcmp(shortbuf,"public")))
so you can list files in the public directory of the classic partition

so if you make the user projects in a public directory you will be able to list them.

yes it appears that _cacheactivate for one vm doesn't apply to other vm's. i just tested this.

cacheactivate.scol:
_load "tests/cacheactivate/cacheactivate.pkg"

main


cacheactivate.pkg:


fun main ()=
	//_cacheActivate; 
	_showconsole;
	
	0;;

loadfilelist.scol:
_load "tests/loadfilelist/loadfilelist.pkg"

main

loadfilelist.pkg

fun listcat (p, q)=

  if p==nil

  then

    q

  else let p -> [h nxt] in

    h::listcat nxt q;;
    
    
    fun secureLoad(pack)=

  let _testpak pack -> ret in

  if (ret == nil) then

  (

    _fooS "xmlparser loading";

    _load pack;

    1;

  )

  else

  (

    _fooS strcat "Error in " ret;

  

   0;

  );;
  fun load_dependencies(parameter) =
let "locked/lib/_mlistlib.pkg"::nil -> list_of_dependencies in
(
		while (list_of_dependencies!= nil)&& (secureLoad hd list_of_dependencies) do
				(
					set list_of_dependencies = tl list_of_dependencies;
					_fooS "dependencies loading";
				);
		//all dependencies have been read
		if list_of_dependencies==nil then
  				(
  				
  							_fooS "done with  dependency loading";
  
  				0;
  				) 
  		else
  				(
  							_fooS "error in dependency loading";
  				0;
  				);
);
0;;
// Takes a list of directories to scan. The second argument should be 'nil'.
// fun [[S r1] [S r1]] [S r1]
fun getFilesInFolder (lDir, out)=
	if lDir == nil then
		out
	else
		let _listofsubdir hd lDir -> reps in
		let _listoffiles hd lDir -> files in
		(
		if reps != nil then set out = listcat getFilesInFolder reps nil out else nil;
		set out = listcat files out;
		getFilesInFolder tl lDir out
		);;

fun main ()=
	//_cacheActivate; 
	_showconsole;
	_fooSList getFilesInFolder "" :: nil nil;
	0;;

if i run cacheactivate.scol first, and then run loadfilelist.scol while cacheactivate.scol is still running, scol still lists all the files in my user partition (Openspace3d). so activating the cache for one vm does not prevent other vm's from reading from the cache.  however activating the cache does act as a bar to reading the user partition for particular vm. (if i put _chacheActivate in the loadfilelist.pkg main function the returned list of files is NIL...perhaps I am not writing the cache path the right way? anyway, if a vm doesn't have _chacheActivate, it will have access to the user partition regardless of another vm using the cache. which is good.  smile

this will relate to the eyecandy thread, since an eyecandy vm could read from the user partition, even if the user has downloaded .pak files with an os3d player and activated the cache.

Offline

#40 12-Dec-2014 19:30:13

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

arkeon wrote:

just another idea ^^
what about the drag and drop for touch devices ?

it's hard to drag a file icon from a file explorer into the scol interface with your thumb, especially if the windows file explorer is set to small icons or details.  and making a custom file selection interface that is friendly to clumsy fingers is better from a user experience perspective in my opinion.

Offline

#41 12-Dec-2014 21:41:26

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,023
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

_cacheActivate works ONLY for the VM where (and when) this function is called. Always.

Offline

#42 12-Dec-2014 21:42:55

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

iri wrote:

_cacheActivate works ONLY for the VM where (and when) this function is called. Always.

that's great.....by using two vm's, that will allow scol to always know where a user's local .xos files are.

Offline

#43 12-Dec-2014 21:46:13

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,023
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

hebdemnobad wrote:

this will relate to the eyecandy thread, since an eyecandy vm could read from the user partition, even if the user has downloaded .pak files with an os3d player and activated the cache.

Indeed, you could get a files list to the player from the eyecandy. However, the eyecandy should keep alive (or define a predefined path only and set the list at the startup).

Offline

#44 12-Dec-2014 21:49:22

iri
Admin. / Scol language & Scol apps developer
From: France
Registered: 22-Feb-2009
Posts: 2,023
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

hebdemnobad wrote:
iri wrote:

_cacheActivate works ONLY for the VM where (and when) this function is called. Always.

that's great.....by using two vm's, that will allow scol to always know where a user's local .xos files are.

For info, except the primary VM, all VMs are isolated (each has its own channel, by example)

Offline

#45 12-Dec-2014 21:49:35

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

iri wrote:
hebdemnobad wrote:

this will relate to the eyecandy thread, since an eyecandy vm could read from the user partition, even if the user has downloaded .pak files with an os3d player and activated the cache.

Indeed, you could get a files list to the player from the eyecandy. However, the eyecandy should keep alive (or define a predefined path only and set the list at the startup).

I am designing the lightweight eyecandy component to last through the entire player session. It will be used not only for startup but for loading screens when the player is busy loading a project (since the vm doing the loading of a scene is unresponsive, the more complicated the scene, the longer the period of unresponsiveness).

Offline

#46 12-Dec-2014 21:49:46

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 4,461
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

did you try the public directory ?

add a "public folder" in the OpenSpace3D directory
and add files in it
then even with cache activated you should be able to list files from _listoffiles "public"

Offline

#47 12-Dec-2014 21:58:02

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

arkeon wrote:

did you try the public directory ?

add a "public folder" in the OpenSpace3D directory
and add files in it
then even with cache activated you should be able to list files from _listoffiles "public"

I haven't tried that. But using two vm's solves the problem well without making users have to create specifically named folders. The less a user has to use a keyboard with a touchscreen device, the better.

Since 2 vm's can always get the list of files in the cache and user partition, now I'm left with the question of the most reliable interface to create for users with only thumbs.

should i use webnavigator and javascript to create a list of big buttons (each representing a local .xos scene), or the scol 2d graphic api?

Offline

#48 12-Dec-2014 22:00:44

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 4,461
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

as you want, but keep in mind that popup windows or 2D content out of the 3D buffer won't work on other devices or windows metro.

Offline

#49 12-Dec-2014 23:30:55

hebdemnobad
Member
From: northamerica
Registered: 20-Apr-2011
Posts: 1,477
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

arkeon wrote:

as you want, but keep in mind that popup windows or 2D content out of the 3D buffer won't work on other devices or windows metro.

Will multiple vms be able to run on these devices?

Last edited by hebdemnobad (12-Dec-2014 23:31:39)

Offline

#50 12-Dec-2014 23:46:57

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 4,461
Website

Re: once _cacheActivate is called, can the vm still access the upartition?

don't know yet ^^

Offline

Board footer

Powered by FluxBB