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
| Result | Name / Params | Comment |
|---|
| GetResult | file.Get | Returns a filtered list of FileInfo Objects. |
| filter | string | (Optional) Filter expression which determines the result set. |
| select | string[] | (Optional) List of properties that should be contained in the result objects. |
| limit | int | (Optional) Maximum amount of Objects that should be returned. |
| offset | int | (Optional) Offset of the first Object in the result set that should be returned. Used for direct pagination. |
| scroll | int | (Optional) Scrolls through the result set with 'Next' or 'Prev'. Used for pagination. See EnumPaginationScroll. |
| context | string | (Optional) The context received within the last get result. Mandatory for subsequent get calls with pagination. |
| FileInfo | file.GetOne | Returns a single File Object identified by the given id. |
| file | string | |
| select | string[] | (Optional) List of properties that should be contained in the result object. |
| int | file.Exists | Checks if a file or folder exists. Result: See EnumFileType. |
| file | string | Path or Id of File or Folder. |
| bool | file.Set | Sets specific properties of a FileInfo Object. |
| id | guid | Id of the FileInfo to modify. |
| props | value{} | List of properties that should be set. Property paths may be used as ids to address any partial aspect of the Object. |
| bool | file.Delete | Deletes a file or folder. |
| file | string | Path or Id of File or Folder. Folders will be deleted with content. Pre defined folders may not be deleted. |
| bool | file.EnsurePathExists | Ensures a (folder) path exists and creates intermediate folders if needed. |
| path | string | Only existing root folders may be used. |
| bool | file.CreateFolder | Creates a folder. |
| parentId | guid | (Optional) Either parent id and name or path must be provided. |
| segmentId | guid | (Optional) |
| name | string | (Optional) |
| path | string | (Optional) |
| desc | string | (Optional) |
| FileInfo | file.WriteFile | Writes data to a file. If the file already exists, any previous data is cleared. |
| parentId | guid | (Optional) Either parent id and name or path must be provided. |
| segmentId | guid | (Optional) |
| name | string | (Optional) |
| file | string | (Optional) Path of new or existing file or id of existing file. |
| desc | string | (Optional) |
| data | data | |
| data | file.ReadFile | Reads the contents of a file. |
| file | string | Path or Id of File or Folder. |
| bool | file.Move | Moves a file or folder. |
| file | string | File or folder as path or id. |
| dest | string | If id this can only be a folder, the 'file' will be put inside. If path, works like move in windows file system |
Notifications
| Name / Params | Comment |
|---|
| file.Created | Notifies new FileInfos. |
| objects | FileInfo[] | Newly created FileInfos. |
| file.Updated | Notifies updated FileInfos. |
| objects | FileInfo[] | Changed FileInfos. |
| file.Deleted | Notifies deleted FileInfos. |
| ids | guid[] | 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} |
|
| 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