remove()

The function remove() deletes a file.

Synopsis

intremove(stringfileName);

Parameters

Parameters Meaning
fileName The file name (and file path) that should be removed, for example, string fileName = "C://Dokuments//testFile.txt";

Return Value

If the file was successfully deleted, the function returns 0 and in the event of an error -1.

Description

The function deletes a file. The file path must be specified.

Example

main()
{
   int retVal;
   string fileName = "C:/Documents/testFile.txt";
   retVal = remove(fileName);
   DebugN("The file was removed ");
   DebugN(retVal); /* Shows the return value (0= file was successfully deleted)*/
}     

Assignment

File function

Availability

CTRL