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 16-Dec-2014 16:54:01

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

creating a file nagivation api in scol

colleagues:

i would like to create a file navigation api in scol, something that would use lists and/or arrays to do the following. the first step would just be to display values in the console:

1. contain all the .xos fils in the user partition
2. contain all the .pak files in the cache partition
3. contains a history of the files that the user navigates to as a list since the very first time the app is run.
4. a 'home' function to navigate back to the user partition or cache
5. up, down, forward, and backward functions to navigate through the scol partitions
6. loading and storing variables, lists, and arrays (the latter may not be needed) from an .xml file on the app startup
7. contains a 'favorites' list (well, maybe not, not necessary)
8. contains a 'recent' list (well, maybe not , not necessary)
a big job, i will start working on the first step, using iri's listcat example

Last edited by hebdemnobad (16-Dec-2014 19:54:26)

Offline

#2 18-Dec-2014 15:24:41

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

Re: creating a file nagivation api in scol

ok, after some thinking i think this may be the way to get going....with an object that represents a folder location, the siblings of the folder (which can be either folders or files or both), their full paths, their display names (just the name of the file or Folder, for displaying to the user in a webnavitor ui or scol window/container ui), and the parent of the folder:

struct File_navigator =	
[
	//file navigator parent, contains path name and display name (name of file or folder without path to display to user) 
          File_navigator_parent		               :   [S S],
	//file navigator sibling [S= full path S=display name (name of file or folder without path to display to user) 
	File_navigator_file_siblings		: [[S S] r1],
	File_navigator_folder_siblings		: [[S S] r1]
] mkFile_navigator;;
								
//a file navigator holds the information necessary to display the contents of a folder's parent's child folders and child files

any input welcome
-h

Offline

#3 19-Dec-2014 10:35:20

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

Re: creating a file nagivation api in scol

Hello,

Why not ...
I haven't really thought but i think i'll write something like :

struct FNavigator = [
	fn_parent : FNavigator,
	fn_path : S,
	fn_name : S,
	fn_files : [S r1],
	fn_subdirs : [FNavigator r1]
	] mkFNavigator;;

This is a recursive structure. You can navigate in your tree in both directions.
- fn_parent is the parent node, nil for the big father
- fn_path and fn_name are the path and the display name of this node
- fn_files is the list of all file names (the path should be already known from fn_path)
- fun_subdirs is a list of child nodes, nil if no subdir.

Note : fn_path is a convenience, you could get it by recursion but it is more cost to set this field.

Offline

#4 19-Dec-2014 14:27:29

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

Re: creating a file nagivation api in scol

Thx Iri... I have to think whether the vm creates the file tree in realtime or constructs an XML file that contains a model of the user partition file tree.  And that relates to having my media octopus app talk to another VM that has access to the user partition....only strings can be passed between vms. I need a pencil and paper for this. smile

Ack! One issue gives birth to another which in turn gives birth to yet another.

Last edited by hebdemnobad (19-Dec-2014 14:29:05)

Offline

#5 19-Dec-2014 14:50:22

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

Re: creating a file nagivation api in scol

hebdemnobad wrote:

only strings can be passed between vms

S, I and F wink

If you store the tree in a xml file (by example at the startup), you can not perform an update (if the user adds a file from its files explorer or any other way).

However, you can handle the current directory only :
By default, this could be root (""). So, you list only file names and the name of subdirs.
If the user select a subdir, you handle it and display only the file names and the name of the subdirs. For that you read the content only at this moment.
Etc ...
To prevent to browse the full tree.
The communication between two local VMs should be fast.

Offline

#6 19-Dec-2014 15:26:28

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

Re: creating a file nagivation api in scol

iri wrote:
hebdemnobad wrote:

only strings can be passed between vms

S, I and F wink

If you store the tree in a xml file (by example at the startup), you can not perform an update (if the user adds a file from its files explorer or any other way).

However, you can handle the current directory only :
By default, this could be root (""). So, you list only file names and the name of subdirs.
If the user select a subdir, you handle it and display only the file names and the name of the subdirs. For that you read the content only at this moment.
Etc ...
To prevent to browse the full tree.
The communication between two local VMs should be fast.

yes Iri this is what I am thinking. eyecandy vm shows pretty pictures and launches filessearcher vm (its only job is to look through user partition) and mediaotctopus player.  mediaoctopus player gets subdirectorys and list of files from filesearcher vm, which uses some sort of api we have spoken about to traverse the user partition, up, down, sideways, wherever. that way the mediaoctopus player cannot invoke the _deletepack function in the user partition, since the vm with access to the user partition will not execute this function sent from the mediaoctopus player.


that will result in unhappy customers!

..i assume i can have three vm's in communication with each other, correct?


now i see why the cache activation function is so important, i have something like ten years of work in my user partition.

Offline

#7 19-Dec-2014 15:34:43

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

Re: creating a file nagivation api in scol

Why 3 VMs ?
2 seems me sufficient.

Your searcher can be done by the eyecandy.

hebdemnobad wrote:

i assume i can have three vm's in communication with each other, correct?

Yes. Even 4, 5, .... much as you want. But you define a channel between each VM.

Offline

#8 19-Dec-2014 15:44:23

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

Re: creating a file nagivation api in scol

iri wrote:

Why 3 VMs ?
2 seems me sufficient.

Your searcher can be done by the eyecandy.

hebdemnobad wrote:

i assume i can have three vm's in communication with each other, correct?

Yes. Even 4, 5, .... much as you want. But you define a channel between each VM.

you are right...i think i used one of the os3d functions that results in finding every single file in the user partition, and that lead to the console hanging (the resulting log file was 12mb), but yes _listoffiles and _listofsubdir work quickly enough, so probably two vms will do the trick.

then again, there may be a user who has 12mb worth of filenames in his/her user partition. a digital hoarder kind of person.

Offline

#9 19-Dec-2014 18:05:32

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

Re: creating a file nagivation api in scol

That is why it is better to read the current directory only (its files and its subdirs, if any, without browse them).

Offline

Board footer

Powered by FluxBB