ZFILE File Attribute
The server ZFILE File Attribute packet informs the receiving client of the file name and file attributes for the next file to transfer. The packet is sent following receipt of a client ZRINIT packet that indicates that the client is ready to receive a file.
The client response to this packet is a ZRPOS packet that includes the start position in the file at which data transfer is to begin.
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 3 0 | 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PadChars | StartofPacket | FormatType | PacketType | ||||||||||||||||||||||||||||
| Reserved | FileName (variable) | ||||||||||||||||||||||||||||||
| ... | |||||||||||||||||||||||||||||||
| FileLength | ModificationDate (variable) | ||||||||||||||||||||||||||||||
| ... | |||||||||||||||||||||||||||||||
| FileMode | TxSerial | ||||||||||||||||||||||||||||||
| FileCountRemaining | FileLengthRemaining | ||||||||||||||||||||||||||||||
| ... | ZCRCW | ||||||||||||||||||||||||||||||
| CRCCheckBytes | Â | ||||||||||||||||||||||||||||||
Fields
PadChars
Data type: UCHARPad character.
Value Meaning 0x2A Single pad character.
StartofPacket
Data type: UCHARPacket start character.
Value Meaning 0x18 ZDLE: Packet start.
FormatType
Data type: UCHARType of header format.
Value Meaning 0x41 ASCII A: Packet has binary header with 16-bit CRC. This format is used only by a sender when the following data block is binary coded.
PacketType
Data type: UCHARType of packet.
Value Meaning 0x04 ZFILE: File name from sender.
Flag3
Data type: ucharExtended option flags. The value can be:
Value Meaning 0x40 ZXSPARS: Encoding for sparse file operations.
Flag2
Data type: ucharTransport option flags. The value can be one of the following:
Value Meaning 0x01 ZTLZW: Lempel-Ziv compression.
0x02 ZTCRYPT: Encryption.
0x03 ZTRLE: Run length encoding.
Flag1
Data type: ucharFile management option flags. The value can be one of the following:
Value Meaning 0x80 ZMSKNOLOC: Skip file if not present at receiver.
0x01 ZMNEWL: Transfer if source is newer or longer.
0x02 ZMCRC: Transfer if different file CRC or length.
0x03 ZMAPND: Append contents to existing file (if any).
0x04 ZMCLOB: Replace existing file.
0x05 ZMNEW: Transfer if source is newer.
0x06 ZMDIFF: Transfer if dates or lengths are different.
0x07 ZMPROT: Protect destination file.
Flag0
Data type: ucharIf the packet type is ZFILE, the flag value can be a combination of the following:
Value Meaning 0x01 ZCBIN: Binary transfer—inhibit conversion.
0x02 ZCNL: Convert new line character to local end of line convention.
0x03 ZCRESUM: Resume interrupted file transfer.
Reserved
Reserved.FileName
Name of file to be transferred. Null-terminated.FileLength
Estimate of file length in decimal. Terminated by ASCII SPACE character.ModificationDate
Time the contents were last changed, measured in seconds from January 1, 1970, Universal Coordinated Time (UTC). Terminated by ASCII SPACE character. A zero value indicates that the value is unknown, an example value is: "0x3734363231313333353220".FileMode
File mode. Terminated by ASCII SPACE character.Value Meaning 0x3020 HyperTerminal Zmodem transmitter serial number (ASCII 0 ASCII SPACE).
TxSerial
Transmitting program serial number. Terminated by ASCII SPACE character.Value Meaning 0x3020 HyperTerminal Zmodem transmitter serial number (ASCII 0 ASCII SPACE).
FileCountRemaining
Estimate of the number of files remaining to transfer, including the current file. Terminated by a blank character. For example, if only one file is to be transferred: "0x3120".FileLengthRemaining
Estimate of file length remaining in decimal, null-terminated. For example, if 54 bytes remain: "0x353400".ZCRCW
ZCRCW string. Indicates that CRC check bytes are following and an acknowledgment is expected. Null-terminated.Value Meaning 0x186B00 ZCRCW string. Equivalent to <ZDLE><ASCII K><NULL>.
CRCCheckBytes[]
Data type: uchar16-bit CRC check field. For information on the polynomial used for 16-bit CRC calculation, see ITU-T Recommendation V.41, "Code-independent error-control system," November 1989.
Zmodem Hexadecimal Format
Fields in this packet are in Zmodem binary format and are transmitted without further encoding.
Line Control and Escape Sequences
Both a line control sequence and an escape sequence consist of the ZDLE character (0x18) followed by a single character. A line control sequence is a command sent as a character outside the regular packet structure. An escape sequence allows the receiver to ignore the character following the ZDLE character.
| Value | Description |
|---|---|
| 0x180D | Ignored by receiver. |
| 0x1810 | Ignored by receiver. |
| 0x1811 | Ignored by receiver. |
| 0x1813 | Ignored by receiver. |
| 0x1868 (ZDLE + ASCII h) | ZCRCE : CRC next, packet ends, header packet follows. |
| 0x1869 (ZDLE + ASCII I) | ZCRCG: CRC next, packet continues nonstop. |
| 0x186A (ZDLE + ASCII j) | ZCRCQ: CRC next, packet continues, ZACK expected. |
| 0x186B (ZDLE + ASCII k) | ZCRCW: CRC next, ZACK expected, end of packet. |
| 0x186C (ZDLE + ASCII l) | ZRUB0: Translate to rubout 0177. |
| 0x186D (ZDLE + ASCII m) | ZRUB1: Translate to rubout 0377. |
| 0x187F | Ignored by receiver. |
| 0x188D | Ignored by receiver. |
| 0x1890 | Ignored by receiver. |
| 0x1891 | Ignored by receiver. |
| 0x1893 | Ignored by receiver. |
| 0x18FF | Ignored by receiver. |
Remarks
For Microsoft licensing information, see Published Protocols and Royalty-Free License on the Microsoft Developer Network (MSDN).
For more information about CRC, see https://www2.rad.com/networks/1994/err_con/crc.htm.