Skip to main content

ModelCenter APIs 2025 R2

Interface ModelCenter::IFileSystemInfo

Last update: 16.07.2025

Definition: ModelCenter/src/ModelCenter.odl (line 6626)

Represents an object in a structured file system. Can represent a local file, a network file, or anything else.

Members

Properties

Property isValid

Definition: ModelCenter/src/ModelCenter.odl (line 1)

boolean ModelCenter::IFileSystemInfo::isValid

Indicates whether the object is valid.

Return type: boolean

Property exists

Definition: ModelCenter/src/ModelCenter.odl (line 1)

boolean ModelCenter::IFileSystemInfo::exists

Indicates whether the object exists.

NOTE: other operations may fail or return default values if the object does not exist, so be sure to check this first if you have any doubt!

Return type: boolean

Property isWritable

Definition: ModelCenter/src/ModelCenter.odl (line 1)

boolean ModelCenter::IFileSystemInfo::isWritable

Indicates whether the object is writable (true) or read-only (false).

Return type: boolean

Property baseName

Definition: ModelCenter/src/ModelCenter.odl (line 1)

BSTR ModelCenter::IFileSystemInfo::baseName

Get the base filename, regardless of whether this is a version, file, or otherwise. This is the name of the file as it would appear on a local disk.

For example, if this is readme.txt, version 2, this function will return "readme.txt".

Return type: BSTR

Property url

Definition: ModelCenter/src/ModelCenter.odl (line 1)

BSTR ModelCenter::IFileSystemInfo::url

Get the full URL of the object as a string.

Return type: BSTR

Public functions

Function pin

LPDISPATCH ModelCenter::IFileSystemInfo::pin(boolean forWrite, [optional] VARIANT forceCopy)

Pin this file in the cache.

NOTE: There is no guarantee that the resource will actually be cached if it is accessible through a local or (on Windows) UNC path unless you set the optional 'forceCopy' parameter to 'true'. There is a large performance advantage to not having to copy the file into the cache, especially for large files or slow network drives. However, certain functions will not work on an uncached local file, such as revertChanges() (see below). If you know you want to be able to flush and/or revert changes as you work, you should specify 'forceCopy' = 'true'.

NOTE: Pinning a file with 'forceCopy' = 'true' after calling pin() on the same file with 'forceCopy' = 'false' may result in an error.

Parameters:

  • forWrite: Indicates whether this file should be pinned for write; if it doesn't exist, it may be created
  • Indicates: whether to force creating a copy of the file in the cache, even if the file would otherwise be directly accessed through a local path.

Returns:

IDispatch* to an ICachePin object

Parameters:

  • boolean forWrite
  • [optional] VARIANT forceCopy

Return type: LPDISPATCH

Connect with Ansys