Zum Hauptinhalt springen

DrvMoveFile

Das Ereignis wird ausgelöst, wenn eine Datei verschoben wird. Der neue Pfadname befindet sich in FilePathNew.

  • Response
  • MessageId
    • _DrvResMoveFile
    • Id der Antwort
  • ItemHeader
    • _DrvItemHeader
    • Kopf des Datenpakets
  • ProtocolId
    • 0xF3A49E52
    • Id des verwendeten Protokolls
  • ProtocolVersion
    • 0x00040000
    • Version des verwendeten Protokolls
  • ItemFileCustom
  • Custom01
    • alpha
    • Benutzerdefinierte Informationen
  • ItemFileSize
  • FileSize
    • bigint
    • Größe der Datei (in Bytes)
  • ItemFileAttributes
  • FileAttributes
    • int
    • Dateiattribute
  • ItemFileTime
  • CreationTime
    • bigint
    • Zeitstempel der Erzeugung der Datei
  • LastAccessTime
    • bigint
    • Zeitstempel des letzten Zugriffs
  • LastWriteTime
    • bigint
    • Zeitstempel der letzten Änderung
  • ItemFileAuthorisation
  • UserId
    • int
    • Zugriffs-Id
  • Authorisation
    • int
    • Berechtigungen
  • ItemResult
  • Result
    • int
    • 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 verschoben, wenn in Result _ErrOk (0) angegeben wird. Durch das Setzen eines _ErrFsi...-Wertes können andere Fehlerzustände übermittelt werden.

Beispiel:

if (tDrvRequestMessageId = _DrvReqMoveFile)
{
tDrvMsxWrite # MsxOpen(_MsxSocket | _MsxWrite, tSck);

tDrvMsxWrite->MsxWrite(_MsxMessage, _DrvResMoveFile);
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();
}