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.

#1 20-Nov-2014 23:22:55

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

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

colleagues:

once _cacheActivate  is called  in a scol app, can the vm be programmed to return to the default partition (OpenSpace3d if you have os3d installed)?
thx
-h

Offline

#2 20-Nov-2014 23:43:37

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

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

No to write.

Offline

#3 20-Nov-2014 23:53:10

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:

No to write.

thx iri

I see, so the vm could still open files from the default partition....does the online api show would it would navigate there (in doing the tablet app project i've realized that opening files with the default windows ui is impossible, it would be better for scol to handle with the 2d graphic ui and icons....it's all in the all thumbs...)

Offline

#4 21-Nov-2014 09:51:00

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

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

hebdemnobad wrote:

(in doing the tablet app project i've realized that opening files with the default windows ui is impossible

Can you precise this ?

hebdemnobad wrote:

I see, so the vm could still open files from the default partition....does the online api show would it would navigate there (in doing the tablet app project i've realized that opening files with the default windows ui is impossible, it would be better for scol to handle with the 2d graphic ui and icons....it's all in the all thumbs...)

For that, you could use the File system API. Especially :
- _listofsubdir to list the sub directories for a given directory
- _listoffiles to list the files in a given directory

Here is a quick example to implement it :

// 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 ()=
	_showconsole;
	_fooSList getFilesInFolder "lib/" :: nil nil;
	0;;

This can take a moment if a directory is bigger.
Note : the listcat function is defined in "locked/lib/_mlistlib.pkg" package.

Offline

#5 21-Nov-2014 14:54:08

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:

(in doing the tablet app project i've realized that opening files with the default windows ui is impossible

Can you precise this ?

yes. if you are not using a stylus, it is very difficult to pick a single file to open.  you can make it easier with the windows open dialog view>large icons or extra large icons, but selecting view (or from any desktop style menu) is itself difficult with an index finger, let alone a thumb. i shouldn't say impossible, a better word is impracticable and frustrating.

it would be better to use a scol window with a list of icons you can swipe through, like the interface for opening files on android devices. you open a folder with your thumb, and pick a file with your thumb.  if the file opening ui is close enough to one side of the tablet, you can hold the tablet with one hand and scroll with the thumb of the same hand.

iri wrote:
hebdemnobad wrote:

I see, so the vm could still open files from the default partition....does the online api show would it would navigate there (in doing the tablet app project i've realized that opening files with the default windows ui is impossible, it would be better for scol to handle with the 2d graphic ui and icons....it's all in the all thumbs...)

For that, you could use the File system API. Especially :
- _listofsubdir to list the sub directories for a given directory
- _listoffiles to list the files in a given directory

Here is a quick example to implement it :

// 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 ()=
	_showconsole;
	_fooSList getFilesInFolder "lib/" :: nil nil;
	0;;

This can take a moment if a directory is bigger.
Note : the listcat function is defined in "locked/lib/_mlistlib.pkg" package.

thx iri!!!!

does this code allow the user to navigate from the cache partition back to the user partition (or can it search for files in the user partition once the cache partition has been activated?)  what i'm thinking is lets say a user has downloaded some .pak files and looked at them, but then he/she wants to open a local .xos file to view or show to another person...that's the issue i'm trying to address.

Offline

#6 21-Nov-2014 15:40:29

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

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

The goal of the Scol cache is for a network application, between a server and a client.
This cache is on the client. If a file is ok (good size, good hash, ...) it is used. Else (or if it is missing), it is downloaded from the server. This should be the common use.
These files can be packages or any other resources.

Once the Scol cache activated, other Scol partitions become unreachable. They keep safe.

Offline

#7 21-Nov-2014 16:04: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?

iri wrote:

The goal of the Scol cache is for a network application, between a server and a client.
This cache is on the client. If a file is ok (good size, good hash, ...) it is used. Else (or if it is missing), it is downloaded from the server. This should be the common use.
These files can be packages or any other resources.

Once the Scol cache activated, other Scol partitions become unreachable. They keep safe.

I see. So if I want to view local files and downloaded .pak files in the same session of using a vm, i should export my .xos files to .pak's in the cache partition.

Offline

#8 21-Nov-2014 16:22:33

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

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

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

Offline

#9 24-Nov-2014 19:15: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.

thx, iri...do you mean using the webnavigator to navigate through the local hard drive?

is there a way that the vm can navigate back to the user partition (using the 2sd core api's and whatever os3d high level apis have to offer) once the cache has been activated, if only to read local .xos files?

Offline

#10 26-Nov-2014 15:48:28

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

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

Hello,

No. Once the cache is enabled, you can not read the user partition.

Offline

#11 26-Nov-2014 16:26: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:

Hello,

No. Once the cache is enabled, you can not read the user partition.

I see, thanks. So if a user actviates the cache to look at online .pak files, he/she cannot switch back to the user partition to see .xos files.

once the cache has been activated, will .xos files saved to the cache partition be able to load resources from the user partition once the cache is activated, or is that impossible as well since the user partition cannot be read?

is there a workaround to this (putting a button in the editor that allows the editor to save .xos files to the cache and copy the .xos dependency files to the cache? or is that impossible since you have to activate the cache to save files there, and once the .xos file is saved, the dependency folders cannot be copied?)

Offline

#12 26-Nov-2014 18:05:27

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

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

iri wrote:

Hello,

No. Once the cache is enabled, you can not read the user partition.


just a precision :
when you have a file in a prioritized partition (cache when it's enable) you can only access this file.
but if the file is not present in the current default partition it can read it from another one (depending of the priorities)

Offline

#13 26-Nov-2014 18:06:50

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:
iri wrote:

Hello,

No. Once the cache is enabled, you can not read the user partition.


just a precision :
when you have a file in a prioritized partition (cache when it's enable) you can only access this file.
but if the file is not present in the current default partition it can read it from another one (depending of the priorities)

I see, so  the vm cannot give me a list of files in the user partition once the cache partition has been enabled, correct? (these questions are in the context of building a scol file selection interface for touchscreens, the windows file open dialog isn't friendly for fingers and thumbs)

Last edited by hebdemnobad (26-Nov-2014 18:07:48)

Offline

#14 26-Nov-2014 18:10:35

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

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

hmm good question I don't remember

Offline

#15 26-Nov-2014 18:13: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:

hmm good question I don't remember

the only workaround i can think of is publish a .pak to the user partition and copy by hand to the cache, but if you do that with the editor, you have to shut it down before you try to load resources from the user partition again.

i guess i will try some simple scripts...it's important for any app where someone want to view their own and downloaded os3d content.

Offline

#16 26-Nov-2014 18:16:24

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

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

As I remember on SCS it list the files from all partitions.

Offline

#17 26-Nov-2014 18:18:17

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 I remember on SCS it list the files from all partitions.


where in the api/on scolring/on redmine can i find code that generates such a list? thx.

Offline

#18 26-Nov-2014 18:21:04

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

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

hebdemnobad wrote:
arkeon wrote:
iri wrote:

Hello,

No. Once the cache is enabled, you can not read the user partition.


just a precision :
when you have a file in a prioritized partition (cache when it's enable) you can only access this file.
but if the file is not present in the current default partition it can read it from another one (depending of the priorities)

I see, so  the vm cannot give me a list of files in the user partition once the cache partition has been enabled, correct? (these questions are in the context of building a scol file selection interface for touchscreens, the windows file open dialog isn't friendly for fingers and thumbs)

No, you can not get this list.
But yes, if you give a pathname in the user (or system) partition, you can read it (but not write into it)

Offline

#19 26-Nov-2014 18:24:53

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 iri, do you have any ideas/workarounds for this issue (viewing downloaded os3d files and user created local ones in the user partition in the same scol session)

Offline

#20 26-Nov-2014 18:26:30

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

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

hebdemnobad wrote:

where in the api/on scolring/on redmine can i find code that generates such a list? thx.

I've given the only api in my post #4, in this same thread.
You can not list outside the current partition.

But if you set directly a pathname, you can read it

example :

_fooS _getpack _checkpack "myfolder/myfile.txt";

Offline

#21 26-Nov-2014 18:30:11

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

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

hebdemnobad wrote:

thx iri, do you have any ideas/workarounds for this issue (viewing downloaded os3d files and user created local ones in the user partition in the same scol session)

You can perform a list of xos file in a predefined directory before activate the cache. The user could select a project in this list.
Or, maybe, in Javascript (but i know bad this)

Offline

#22 26-Nov-2014 18:31: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?

perhaps a workaround for the player app i am using is to scan and load the pathnames of all .xos files at startup, then once the cache is activated the user can still retrieve the .xos files from the list. the list could be saved to an .xml file...maybe that would work

hey i was writing this post while you were writing your post! i'm thinking like a scol coder now...

Last edited by hebdemnobad (26-Nov-2014 18:32:17)

Offline

#23 26-Nov-2014 19:14:13

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

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

wink

Offline

#24 8-Dec-2014 21:55:09

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 just did some checking with the editor and os3d player...so this blocking of reading the user partition arises only on the vm level correct? (after downloading a .pak with the embedded plugin on a web page, i started up the editor, and then the player, and the latter two open up the user partition as a default.)

for example, if i download a .pak file by viewing a scene with the embedded os3d player, and then start up the os3d editor (a separate vm instance, i think), or os3d player(a separate vm instance, i think),, the editor and player still default to the user partition.

Offline

#25 8-Dec-2014 22:00:04

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

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

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

Offline

Board footer

Powered by FluxBB