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.
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
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
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
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
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
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
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
I
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
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
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
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
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 partitionso 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.
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
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
_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
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
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
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
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
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
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
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