bool CreateFile(string, bool)

Creates a file at the given file path

Security

Trust Level Required: Full Trust

Parameters

Name Description
filePath string
The path of the new file.
createDir (Optional) bool
True to create a new directory for the file. Defaults to false.

Return

True upon success, and false if the file did not exist.

Remarks

Creating a file or directory in the UserData Directory will ensure that the file exists in all users with access to the C:. This is useful for testing settings as an admin user and running a kiosk as a separate, standard user. The variables needed to access KioWare Client's data directories are used in the following example. The kiosk user must have sufficient permissions to perform any file IO operation that performs a read or write operation on the current disk.

Examples


var sampleFile = KioApp.DoUrlSubstitution('$$KIO_USERDATA$$') + 'sampleFile.txt';
if(KioFileIO.CreateFile(sampleFile))
	var fileInfo = KioFileIO.GetFileDetails(sampleFile);
else console.log('Failed to create new directory ' + sampleFile);
    

Requirements

KioWare for Windows version 8.2 or greater.