EditFile

(VTScada Layer module. Obtain LayerRoot using the following script-only statement: )

    LayerRoot = \System.GetLoadedAppInstance(GetGUID(0, \LocalGUID));
Description: Informs the configuration management system that a file has been modified in the working copy, typically before making a call to CommitEditedFiles.
Returns: Nothing
Usage: Script Only.
Function Groups: Configuration Management
Related to: CommitEditedFiles
Format: LayerRoot.EditFile(ModItem[, JustInformSubscribers])
Parameters:  
ModItem

Required. A file name, a dictionary of file names, or an array of names of modified files.
File paths relative to the working copy are recommended. Files outside the working copy cannot be added.

If invalid, all the working copy files are used.

If a dictionary, then the keys are the files to use. If the values are FileMetadata, then the structures are expected to be fully populated including the deltas. If the values are streams, then the stream contains the new copy of the file to commit. The stream may contain a Time metadata value for the time stamp. If the metadata is not there, CurrentTime will be used.

Otherwise the dictionary values contain a numeric value with options as follows:

  • 0 means the file is added, modified or deleted based on the working copy file
  • 1 mean the file is deleted from working copy
  • 2 mean ignore the file in the working copy

The default for this value is 0

JustInformSubscribers
Optional Boolean. Set TRUE to not mark the file as modified. This is useful when switching between repository revisions.Defaults to FALSE.
Comments:

This function must be called only if the caller has the semaphore (working copy lock). The files will be added to the Modified dictionary so that it is distributed to all subscribers when the transaction is closed.

If a set of files is passed, then the values will also be passed to the repository. The primary purpose of this is that it allows for files to be marked as ignored.