Home » CEEFAX disks » telesoftware14.adl » 01-04-89/FD\C
01-04-89/FD\C
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » CEEFAX disks » telesoftware14.adl |
Filename: | 01-04-89/FD\C |
Read OK: | ✔ |
File size: | 06C4 bytes |
Load address: | 0000 |
Exec address: | FFFFFFFF |
File contents
/* This program prints out a full directory including hidden files complete with file attributes. By P Brough */ #include <dos.h> #include <stdio.h> main(argc,argv) int argc; char *argv[]; { int file_count=0,sub_count=0; long total_bytes=0; char cwd[65]; struct FIND *p; printf(" ���������������������������������������������������ͻ\n"); printf(" �FD - A Full Directory Listing - By Philip Brough �\n"); printf(" ���������������������������������������������������ͼ\n"); system(" vol"); getcwd(cwd,65); printf("\n Directory of :%s",cwd); printf(" \n Filename Size Date Time Attributes\n"); printf(" �������������������������������������������������������������������������������\n"); if (argc==1) p = findfirst("*.*",0xFF); else { p = findfirst(argv[1],0xFF); } while(p) { if (p->attribute & 0x10) printf( "\n%-12s <DIR> ",p->name); else printf( "\n%-12s\t%-8lu ",p->name,p->size); printf(" %02d-%02d-%02d %02d:%02d ",(p->date)&31, (p->date)>>5&15,((p->date)>>9)+80, (p->time>>11),((p->time)>>5)&63); { if (p->attribute & 0x01) printf("Read-Only "); if (p->attribute & 0x02) printf("Hidden "); if (p->attribute & 0x04) printf("System "); if (p->attribute & 0x10) { printf("Subdirectory "); sub_count++; } if (p->attribute &0x20) printf("Archive "); } file_count++; total_bytes += p->size; p=findnext(); } printf("\n %d files containing %ld bytes",file_count,total_bytes); printf("\n %d Subdirectories found",sub_count); }
00000000 2f 2a 0d 0a 0d 0a 54 68 69 73 20 70 72 6f 67 72 |/*....This progr| 00000010 61 6d 20 70 72 69 6e 74 73 20 6f 75 74 20 61 20 |am prints out a | 00000020 66 75 6c 6c 20 64 69 72 65 63 74 6f 72 79 20 69 |full directory i| 00000030 6e 63 6c 75 64 69 6e 67 20 68 69 64 64 65 6e 20 |ncluding hidden | 00000040 66 69 6c 65 73 0d 0a 63 6f 6d 70 6c 65 74 65 20 |files..complete | 00000050 77 69 74 68 20 66 69 6c 65 20 61 74 74 72 69 62 |with file attrib| 00000060 75 74 65 73 2e 0d 0a 0d 0a 42 79 20 50 20 42 72 |utes.....By P Br| 00000070 6f 75 67 68 0d 0a 0d 0a 2a 2f 0d 0a 0d 0a 23 69 |ough....*/....#i| 00000080 6e 63 6c 75 64 65 20 3c 64 6f 73 2e 68 3e 0d 0a |nclude <dos.h>..| 00000090 23 69 6e 63 6c 75 64 65 20 3c 73 74 64 69 6f 2e |#include <stdio.| 000000a0 68 3e 0d 0a 6d 61 69 6e 28 61 72 67 63 2c 61 72 |h>..main(argc,ar| 000000b0 67 76 29 0d 0a 69 6e 74 20 61 72 67 63 3b 0d 0a |gv)..int argc;..| 000000c0 63 68 61 72 20 2a 61 72 67 76 5b 5d 3b 0d 0a 0d |char *argv[];...| 000000d0 0a 7b 0d 0a 69 6e 74 20 66 69 6c 65 5f 63 6f 75 |.{..int file_cou| 000000e0 6e 74 3d 30 2c 73 75 62 5f 63 6f 75 6e 74 3d 30 |nt=0,sub_count=0| 000000f0 3b 0d 0a 6c 6f 6e 67 20 74 6f 74 61 6c 5f 62 79 |;..long total_by| 00000100 74 65 73 3d 30 3b 0d 0a 63 68 61 72 20 63 77 64 |tes=0;..char cwd| 00000110 5b 36 35 5d 3b 0d 0a 73 74 72 75 63 74 20 46 49 |[65];..struct FI| 00000120 4e 44 20 2a 70 3b 0d 0a 0d 0a 09 70 72 69 6e 74 |ND *p;.....print| 00000130 66 28 22 20 c9 cd cd cd cd cd cd cd cd cd cd cd |f(" ............| 00000140 cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd |................| * 00000160 cd cd cd cd cd cd cd cd bb 5c 6e 22 29 3b 0d 0a |.........\n");..| 00000170 09 70 72 69 6e 74 66 28 22 20 ba 46 44 20 2d 20 |.printf(" .FD - | 00000180 41 20 46 75 6c 6c 20 44 69 72 65 63 74 6f 72 79 |A Full Directory| 00000190 20 4c 69 73 74 69 6e 67 20 2d 20 42 79 20 50 68 | Listing - By Ph| 000001a0 69 6c 69 70 20 42 72 6f 75 67 68 20 20 20 ba 5c |ilip Brough .\| 000001b0 6e 22 29 3b 0d 0a 09 70 72 69 6e 74 66 28 22 20 |n");...printf(" | 000001c0 c8 cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd |................| 000001d0 cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd |................| * 000001f0 cd cd cd cd bc 5c 6e 22 29 3b 0d 0a 09 73 79 73 |.....\n");...sys| 00000200 74 65 6d 28 22 20 76 6f 6c 22 29 3b 0d 0a 09 67 |tem(" vol");...g| 00000210 65 74 63 77 64 28 63 77 64 2c 36 35 29 3b 0d 0a |etcwd(cwd,65);..| 00000220 09 70 72 69 6e 74 66 28 22 5c 6e 20 44 69 72 65 |.printf("\n Dire| 00000230 63 74 6f 72 79 20 6f 66 20 3a 25 73 22 2c 63 77 |ctory of :%s",cw| 00000240 64 29 3b 0d 0a 09 70 72 69 6e 74 66 28 22 20 5c |d);...printf(" \| 00000250 6e 20 46 69 6c 65 6e 61 6d 65 20 20 20 20 20 20 |n Filename | 00000260 20 53 69 7a 65 20 20 20 20 20 20 20 20 20 20 44 | Size D| 00000270 61 74 65 20 20 20 20 54 69 6d 65 20 20 20 20 20 |ate Time | 00000280 20 20 20 20 20 20 20 20 41 74 74 72 69 62 75 74 | Attribut| 00000290 65 73 5c 6e 22 29 3b 0d 0a 09 20 20 20 70 72 69 |es\n");... pri| 000002a0 6e 74 66 28 22 20 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 |ntf(" ..........| 000002b0 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 c4 |................| * 000002f0 c4 c4 c4 c4 c4 5c 6e 22 29 3b 0d 0a 0d 0a 0d 0a |.....\n");......| 00000300 09 09 69 66 20 28 61 72 67 63 3d 3d 31 29 0d 0a |..if (argc==1)..| 00000310 09 09 09 70 20 3d 20 66 69 6e 64 66 69 72 73 74 |...p = findfirst| 00000320 28 22 2a 2e 2a 22 2c 30 78 46 46 29 3b 0d 0a 09 |("*.*",0xFF);...| 00000330 09 65 6c 73 65 0d 0a 09 09 09 7b 0d 0a 09 09 09 |.else.....{.....| 00000340 70 20 3d 20 66 69 6e 64 66 69 72 73 74 28 61 72 |p = findfirst(ar| 00000350 67 76 5b 31 5d 2c 30 78 46 46 29 3b 0d 0a 09 09 |gv[1],0xFF);....| 00000360 09 7d 0d 0a 09 09 77 68 69 6c 65 28 70 29 0d 0a |.}....while(p)..| 00000370 09 09 7b 0d 0a 09 09 09 69 66 20 28 70 2d 3e 61 |..{.....if (p->a| 00000380 74 74 72 69 62 75 74 65 20 26 20 30 78 31 30 29 |ttribute & 0x10)| 00000390 0d 0a 09 09 09 09 70 72 69 6e 74 66 28 20 22 5c |......printf( "\| 000003a0 6e 25 2d 31 32 73 20 20 20 20 3c 44 49 52 3e 20 |n%-12s <DIR> | 000003b0 20 20 20 20 22 2c 70 2d 3e 6e 61 6d 65 29 3b 0d | ",p->name);.| 000003c0 0a 09 09 09 65 6c 73 65 0d 0a 09 09 09 09 09 0d |....else........| 000003d0 0a 09 09 09 09 70 72 69 6e 74 66 28 20 22 5c 6e |.....printf( "\n| 000003e0 25 2d 31 32 73 5c 74 25 2d 38 6c 75 20 20 22 2c |%-12s\t%-8lu ",| 000003f0 70 2d 3e 6e 61 6d 65 2c 70 2d 3e 73 69 7a 65 29 |p->name,p->size)| 00000400 3b 0d 0a 09 09 09 09 70 72 69 6e 74 66 28 22 20 |;......printf(" | 00000410 25 30 32 64 2d 25 30 32 64 2d 25 30 32 64 20 20 |%02d-%02d-%02d | 00000420 25 30 32 64 3a 25 30 32 64 20 20 22 2c 28 70 2d |%02d:%02d ",(p-| 00000430 3e 64 61 74 65 29 26 33 31 2c 0d 0a 09 09 09 09 |>date)&31,......| 00000440 20 20 20 20 09 28 70 2d 3e 64 61 74 65 29 3e 3e | .(p->date)>>| 00000450 35 26 31 35 2c 28 28 70 2d 3e 64 61 74 65 29 3e |5&15,((p->date)>| 00000460 3e 39 29 2b 38 30 2c 0d 0a 09 09 09 09 20 09 28 |>9)+80,...... .(| 00000470 70 2d 3e 74 69 6d 65 3e 3e 31 31 29 2c 28 28 70 |p->time>>11),((p| 00000480 2d 3e 74 69 6d 65 29 3e 3e 35 29 26 36 33 29 3b |->time)>>5)&63);| 00000490 0d 0a 09 09 09 09 09 7b 0d 0a 09 09 09 09 09 09 |.......{........| 000004a0 69 66 20 28 70 2d 3e 61 74 74 72 69 62 75 74 65 |if (p->attribute| 000004b0 20 26 20 30 78 30 31 29 0d 0a 09 09 09 09 09 09 | & 0x01)........| 000004c0 09 70 72 69 6e 74 66 28 22 52 65 61 64 2d 4f 6e |.printf("Read-On| 000004d0 6c 79 20 22 29 3b 0d 0a 09 09 09 09 09 09 69 66 |ly ");........if| 000004e0 20 28 70 2d 3e 61 74 74 72 69 62 75 74 65 20 26 | (p->attribute &| 000004f0 20 30 78 30 32 29 0d 0a 09 09 09 09 09 09 09 70 | 0x02).........p| 00000500 72 69 6e 74 66 28 22 48 69 64 64 65 6e 20 22 29 |rintf("Hidden ")| 00000510 3b 0d 0a 09 09 09 09 09 09 69 66 20 28 70 2d 3e |;........if (p->| 00000520 61 74 74 72 69 62 75 74 65 20 26 20 30 78 30 34 |attribute & 0x04| 00000530 29 0d 0a 09 09 09 09 09 09 09 70 72 69 6e 74 66 |).........printf| 00000540 28 22 53 79 73 74 65 6d 20 22 29 3b 0d 0a 09 09 |("System ");....| 00000550 09 09 09 09 69 66 20 28 70 2d 3e 61 74 74 72 69 |....if (p->attri| 00000560 62 75 74 65 20 26 20 30 78 31 30 29 0d 0a 09 09 |bute & 0x10)....| 00000570 09 09 09 09 09 7b 0d 0a 09 09 09 09 09 09 09 70 |.....{.........p| 00000580 72 69 6e 74 66 28 22 53 75 62 64 69 72 65 63 74 |rintf("Subdirect| 00000590 6f 72 79 20 22 29 3b 0d 0a 09 09 09 09 09 09 09 |ory ");.........| 000005a0 73 75 62 5f 63 6f 75 6e 74 2b 2b 3b 0d 0a 09 09 |sub_count++;....| 000005b0 09 09 09 09 09 7d 0d 0a 09 09 09 09 09 09 69 66 |.....}........if| 000005c0 20 28 70 2d 3e 61 74 74 72 69 62 75 74 65 20 26 | (p->attribute &| 000005d0 30 78 32 30 29 0d 0a 09 09 09 09 09 09 09 70 72 |0x20).........pr| 000005e0 69 6e 74 66 28 22 41 72 63 68 69 76 65 20 22 29 |intf("Archive ")| 000005f0 3b 0d 0a 09 09 09 09 09 7d 09 09 20 20 20 0d 0a |;.......}.. ..| 00000600 09 09 09 09 0d 0a 09 09 09 66 69 6c 65 5f 63 6f |.........file_co| 00000610 75 6e 74 2b 2b 3b 0d 0a 09 09 09 74 6f 74 61 6c |unt++;.....total| 00000620 5f 62 79 74 65 73 20 2b 3d 20 70 2d 3e 73 69 7a |_bytes += p->siz| 00000630 65 3b 0d 0a 09 09 70 3d 66 69 6e 64 6e 65 78 74 |e;....p=findnext| 00000640 28 29 3b 0d 0a 09 09 7d 0d 0a 70 72 69 6e 74 66 |();....}..printf| 00000650 28 22 5c 6e 20 25 64 20 66 69 6c 65 73 20 63 6f |("\n %d files co| 00000660 6e 74 61 69 6e 69 6e 67 20 25 6c 64 20 62 79 74 |ntaining %ld byt| 00000670 65 73 22 2c 66 69 6c 65 5f 63 6f 75 6e 74 2c 74 |es",file_count,t| 00000680 6f 74 61 6c 5f 62 79 74 65 73 29 3b 0d 0a 70 72 |otal_bytes);..pr| 00000690 69 6e 74 66 28 22 5c 6e 20 25 64 20 53 75 62 64 |intf("\n %d Subd| 000006a0 69 72 65 63 74 6f 72 69 65 73 20 66 6f 75 6e 64 |irectories found| 000006b0 22 2c 73 75 62 5f 63 6f 75 6e 74 29 3b 0d 0a 7d |",sub_count);..}| 000006c0 0d 0a 0d 0a |....| 000006c4