Storages & Files CreateSubStorage
CreateSubStorage method

A helper method that allows the application to create a storage in depth (i.e. not only direct descendants of the storage).

Syntax:

Set strm = object.CreateSubStorage( path [, SF_Flags])

Parameters:

path - relative path of the sub-storage. For example: "substorage1\substorage2\storagetoopen". See remarks.

SF_Flags - the standard SF flags.

returned value: the created storage - SFStorage object for it.

Examples:

Set sf = Server.CreateObject("newObjects.utilctls.SFMain")
Set stg = sf.OpenStorageFile("C:\mystoragefile.stg")
Set strm = stg.CreateSubStorage("substorage\substorage_to_open")

Remarks:

This method is most likely useful for non-file system storages (OLE files or external implementations). It allows the application to create a storage directly by passing a string containing relative path to it in abstract notation. Of course the method can be used with every storage including directories.

path string - is abstract storage path very similar to the directory paths in the file system. The "\" or "/" delimiters can be used to separate the names of the storages in it. For example "a\b\c" will mean the item "c" in the storage "b" which is in turn in the storage "a". The virtual root is the storage whose member is called. 

Limitations: The basic features supported by all the storages cause some limitations - the path to the sub-item should be accessible which means no storage in the path must be locked for exclusive use in order method to work correctly. The method requires read access to all the storages specified in the path string.

Applies to: SFStorage object

See also: OpenSubStorage

newObjects Copyright 2001-2006 newObjects [ ]