Skip to content
tmays edited this page Jul 30, 2013 · 10 revisions

You need to work with a lot of paths when working on an intermedia project. This could be audio files, video files, text files or anything that you want to work with.

You have several ways to do this in span, and all these ways are linked to the paths function of span.

Paths are recorded in a json-sting like this :

"MyFirstPath" : {     
    "tags" : "null",     
    "type" : MooV,     
    "valid" : 1,     
    "name" : "name extracted with the strippath object from max"     
}     

**So you could not have the same path twice in the span. In case you want more than one access to a same path, you should use the tags.

All the paths are referenced with the absolute path, which is VolumeName:/Path/to/the/file.something.

Add paths to span as references in span

This is the way to reference files and/or folders in span.

Reference a file

send a filepath to /span/paths/add to add this filepath to the span database.
It will be added as a file.

Reference a folder

send a folderpath to /span/paths/add to add this directory to the span database.
####File or Folder mode
send file or folder to /span/paths/add/mode to change the mode of adding a folder.
File Mode : It will add all the files which are in this directory at the moment of the add.
Folder Mode : It will add the directory as a reference and you will request the content of this directory at any moment you want.

span.paths.requests

Query the content of a folder (on the hard drive)
You can also query for the content of a folder if your span-dict-reference is a folder.
For this, you will use the [span.path.request] abstraction.
###get
getfiles ThePathIWantToSearchIn : it will return all the files in this folder
getfiles ThePathIWantToSearchIn type MooV : it will return all the files with type MooV in this folder
getfolders ThePathIWantToSearchIn : it will return all the folders inside this directory
###check
checkpaths : if no args, verify all paths referenced in span
checkpaths ThePathIWantTocheck : if path as arg, check this path
When you use checkpaths, span will add a "valid" property set to 0 if the path is not found ###consolidate
consolidate will move the project and copy all the paths declared in the database into a folder (same name as the project). The paths will be copied into folders named as the type.