Service: File

Read/write access to the virtual file system

The File API functions allow read and write operations on WinGuard’s internal file system, except for the directories Data, Media and Attachments and their content (the last two are readonly).

Functions

ResultName / ParamsComment
GetResultfile.GetReturns a filtered list of FileInfo Objects.
filterstring(Optional) Filter expression which determines the result set.
selectstring[](Optional) List of properties that should be contained in the result objects.
limitint(Optional) Maximum amount of Objects that should be returned.
offsetint(Optional) Offset of the first Object in the result set that should be returned. Used for direct pagination.
scrollint(Optional) Scrolls through the result set with 'Next' or 'Prev'. Used for pagination. See EnumPaginationScroll.
contextstring(Optional) The context received within the last get result. Mandatory for subsequent get calls with pagination.
FileInfofile.GetOneReturns a single File Object identified by the given id.
filestring
selectstring[](Optional) List of properties that should be contained in the result object.
intfile.ExistsChecks if a file or folder exists.
Result: See EnumFileType.
filestringPath or Id of File or Folder.
boolfile.SetSets specific properties of a FileInfo Object.
idguidId of the FileInfo to modify.
propsvalue{}List of properties that should be set. Property paths may be used as ids to address any partial aspect of the Object.
boolfile.DeleteDeletes a file or folder.
filestringPath or Id of File or Folder. Folders will be deleted with content. Pre defined folders may not be deleted.
boolfile.EnsurePathExistsEnsures a (folder) path exists and creates intermediate folders if needed.
pathstringOnly existing root folders may be used.
boolfile.CreateFolderCreates a folder.
parentIdguid(Optional) Either parent id and name or path must be provided.
segmentIdguid(Optional)
namestring(Optional)
pathstring(Optional)
descstring(Optional)
FileInfofile.WriteFileWrites data to a file. If the file already exists, any previous data is cleared.
parentIdguid(Optional) Either parent id and name or path must be provided.
segmentIdguid(Optional)
namestring(Optional)
filestring(Optional) Path of new or existing file or id of existing file.
descstring(Optional)
datadata
datafile.ReadFileReads the contents of a file.
filestringPath or Id of File or Folder.
boolfile.MoveMoves a file or folder.
filestringFile or folder as path or id.
deststringIf id this can only be a folder, the 'file' will be put inside. If path, works like move in windows file system

Notifications

Name / ParamsComment
file.CreatedNotifies new FileInfos.
objectsFileInfo[]Newly created FileInfos.
file.UpdatedNotifies updated FileInfos.
objectsFileInfo[]Changed FileInfos.
file.DeletedNotifies deleted FileInfos.
idsguid[]Ids of the deleted FileInfos.

Objects

FileInfo

Property Type Description
Id guid (Unique, Readonly) The unique Id of the Data Object.
ParentId guid Parent folder in the virtual filesystem. Empty for root folders.
RootId guid (Readonly) Root folder in the virtual filesystem (Attachment, Media, Graphic, …). Used as ‘group’ for files.
SegmentId guid Attached segment.
Name string Name of file or folder, including extension.
Desc string (Localized) User defined description.
Path string (Readonly) Relative path inside the virtual filesystem, e.g. ‘graphics/graphic1.wgd’.
Attributes int (Readonly) See EnumFileAttributes.
Size int (Readonly)
CreateTime time (Readonly)
EditTime time (Readonly, Not in default set)
EditUser string (Readonly, Not in default set)

Enums

EnumFileAttributes (Flags)

Name Value Description
ReadOnly 0x1
Hidden 0x2
System 0x4
Published 0x8
Folder 0x10

EnumFileType

Name Value Description
None 0
File 1
Folder 2

EnumFolderId

Name Value Description
Graphic {6CA84BCD-2BA8-4FD4-95A0-5B048C331B04}
GraphicSymbols {A85ADC49-5913-41E4-B60E-52BC4B116F14}
GraphicButtons {A5FF0B2D-D092-4982-9647-D2C287631797}
Text {359D7B94-7D3A-41C6-8DC6-C5366CA53D53}
TextScripts {C3907490-0AF3-4BBD-BBF0-2842D5980371}
TextReports {CCD5A270-5FAA-45B0-B24A-335E946B8E3D}
Sound {F3D995C8-A329-431B-8261-ED6E89FAC19F}
Data {8D7005ED-7653-46ED-A088-764C68FB16CD}
DataMod {A3590D29-F1E4-4F86-B9DB-2EA0C954C4D8}
Attachment {4645F4DB-80ED-4532-9CCD-31226D268712}
Media {07C41589-83B1-4ADC-BC4A-040A5604476C}
Other {280C374C-A319-4D61-B607-9D08D9141ED6}

EnumPaginationScroll

Name Value Description
Offset 0 Scrolls to fixed position.
Next 1 Scrolls to next items for given context.
Prev 2 Scrolls to previous items for given context.
Last modified September 25, 2026