ChrisOS Research ProjectOperating systems · language systems · graphics · machine emulation
DOCUMENTATION ARCHIVEMAIN BRANCH
ChrisOS/Source reference: APPS/NET/FTP.CC

Source reference: APPS/NET/FTP.CC

Deterministic source record. The complete textual file is reproduced below; this page does not replace architectural interpretation in the authored chapters.

File identity

Field Value
Path APPS/NET/FTP.CC
Lines 35
Bytes 571
SHA-256 1fb3cf10a918d0d6f7e9166180a8530ddda020128c5839f0d9b8b39da6851974
ChrisOS revision da3df29cb397932c43d32373871fb9380e688ade

Detected syntactic dependencies

Line Include
— No preprocessor include detected.

Detected symbols

Line Symbol
1 main

Complete source

The following block is the complete textual file at the recorded revision. No lines are elided, abbreviated or paraphrased.

void main() {
  int cmd;
  int data;
  int c;
  char msg[16];
  viewport(200, 80);
  text(8, 8, "ftp", 0x00FFFFFF);
  cmd = sock_listen(21);
  data = sock_listen(20);
  msg[0] = 50;
  msg[1] = 50;
  msg[2] = 48;
  msg[3] = 32;
  msg[4] = 67;
  msg[5] = 104;
  msg[6] = 114;
  msg[7] = 105;
  msg[8] = 115;
  msg[9] = 13;
  msg[10] = 10;
  msg[11] = 0;
  while (1) {
    c = sock_accept(cmd);
    if (c > 0) {
      sock_send(c, msg, 11);
      sock_close(c);
    }
    c = sock_accept(data);
    if (c > 0) {
      sock_send(c, msg, 11);
      sock_close(c);
    }
  }
}

Role of this record

The atlas guarantees file-by-file traceability. Responsibility, invariants, ownership, concurrency, security, performance and subsystem interactions belong in authored chapters and must cite this file when applicable.

Document record ID: source-1fb3cf10a918d0d6 Reviewed source: da3df29cb397 Class: generated-source-reference