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.
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
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
(in doing the tablet app project i've realized that opening files with the default windows ui is impossible
Can you precise this ?
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
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.
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 directoryHere 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
You can not list files and directories in the user partition (see the 4th post in this thread) if the cache is activated.
Offline