DrvRenameFile
Das Ereignis wird ausgelöst, wenn eine Datei umbenannt wird. Der neue Dateiname befindet sich in FileNameNew.
- Response
MessageId_DrvResRenameFile- Id der Antwort
ItemHeader_DrvItemHeader- Kopf des Datenpakets
ProtocolId0xF3A49E52- Id des verwendeten Protokolls
ProtocolVersion0x00040000- Version des verwendeten Protokolls
ItemFileCustom_DrvItemFileCustom- Informationsbereich für benutzerdefinierte Daten (optional)
Custom01alpha- Benutzerdefinierte Informationen
ItemFileSize_DrvItemFileSize- Informationsbereich der Dateigröße (optional)
FileSizebigint- Größe der Datei (in Bytes)
ItemFileAttributes_DrvItemFileAttributes- Informationsbereich für Dateiattribute (optional)
FileAttributesint- Dateiattribute
ItemFileTime_DrvItemFileTime- Informationsbereich für Dateidatum und -uhrzeit (optional)
CreationTimebigint- Zeitstempel der Erzeugung der Datei
LastAccessTimebigint- Zeitstempel des letzten Zugriffs
LastWriteTimebigint- Zeitstempel der letzten Änderung
ItemFileAuthorisation_DrvItemFileAuthorisation- Informationsbereich für Berechtigungen (optional)
UserIdint- Zugriffs-Id
Authorisationint- Berechtigungen
ItemResult_DrvItemResult- Ergebnis-Bereich
Resultint- Ergebniswert
Die Bereiche ItemFileCustom, ItemFileSize, ItemFileAttributes, ItemFileTime und ItemFileAuthorisation sind optional. Die Informationen werden nur dann geändert, wenn diese Bereiche im Antwortdatenpaket enthalten ist. Zum Löschen der Daten muss ein Leerstring oder 0 (für die int-Werte) angegeben werden. Bei ItemFileTime muss immer ein gültiger Zeitstempel angegeben werden, wenn dieser gesetzt wird.
Die Datei wird nur dann umbenannt, wenn in Result _ErrOk (0) angegeben wird. Durch das Setzen eines _ErrFsi...-Wertes können andere Fehlerzustände übermittelt werden.
Beispiel:
if (tDrvRequestMessageId = _DrvReqRenameFile)
{
tDrvMsxWrite # MsxOpen(_MsxSocket | _MsxWrite, tSck);
tDrvMsxWrite->MsxWrite(_MsxMessage, _DrvResRenameFile);
tDrvMsxWrite->MsxWrite(_MsxItem, _DrvItemHeader); // ItemHeader
tDrvMsxWrite->MsxWrite(_MsxData, 0xF3A49E52); // ProtocolId
tDrvMsxWrite->MsxWrite(_MsxData, 0x00040000); // ProtocolVersion
tDrvMsxWrite->MsxWrite(_MsxItem, _DrvItemFileCustom); // no custom information
tDrvMsxWrite->MsxWrite(_MsxData, '');
// File size
tDrvMsxWrite->MsxWrite(_MsxItem, _DrvItemFileSize); // set file size
tDrvMsxWrite->MsxWrite(_MsxData, tImportedFile->FsiSize64());
tDrvMsxWrite->MsxWrite(_MsxItem, _DrvItemFileAttributes); // set same attributes
tDrvMsxWrite->MsxWrite(_MsxData, tRequestFileAttributes);
tDrvMsxWrite->MsxWrite(_MsxItem, _DrvItemFileTime); // set file time
tDrvMsxWrite->MsxWrite(_MsxData, tRequestFileCreationTime);
tCalSystemTime->vmSystemTime();
tDrvMsxWrite->MsxWrite(_MsxData, CnvBC(tCalSystemTime));
tDrvMsxWrite->MsxWrite(_MsxData, CnvBC(tCalSystemTime));
tDrvMsxWrite->MsxWrite(_MsxItem, _DrvItemFileAuthorisation); // user authorisation for admins
tDrvMsxWrite->MsxWrite(_MsxData, 10);
tDrvMsxWrite->MsxWrite(_MsxData, _DrvAuthAll); // all rights
tDrvMsxWrite->MsxWrite(_MsxItem, _DrvItemFileAuthorisation); // user authorisation for everybody else
tDrvMsxWrite->MsxWrite(_MsxData, 12);
tDrvMsxWrite->MsxWrite(_MsxData, _DrvAuthList | _DrvAuthRead); // read only
tDrvMsxWrite->MsxWrite(_MsxItem, _DrvItemResult); // Write result
tDrvMsxWrite->MsxWrite(_MsxData, _ErrOk);
tDrvMsxWrite->MsxWrite(_MsxEnd, 0);
tDrvMsxWrite->MsxClose();
}