Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!snorkelwacker!usc!wuarchive!uunet!abcfd20.larc.nasa.gov!amiga-request From: amiga-request@abcfd20.larc.nasa.gov (Amiga Sources/Binaries Moderator) Newsgroups: comp.sources.amiga Subject: v90i220: ttime - calculate file transfer time, Part01/01 Message-ID: <1990Aug13.021319.6813@abcfd20.larc.nasa.gov> Date: 13 Aug 90 02:13:19 GMT Sender: tadguy@abcfd20.larc.nasa.gov (Tad Guy) Reply-To: maverick@floopy.uucp (Thomas Schwarz) Organization: NASA Langley Research Center, Hampton, VA USA Lines: 348 Approved: tadguy@abcfd01.larc.nasa.gov (Tad Guy) X-Post-Discussions-To: comp.sys.amiga X-Mail-Submissions-To: amiga@uunet.uu.net Submitted-by: maverick@floopy.uucp (Thomas Schwarz) Posting-number: Volume 90, Issue 220 Archive-name: util/ttime/part01 [ uuencoded executable enclosed ...tad ] This is a short little program that I threw together one day out of boredom. It just figures the length of your file and then takes the baud rate that you enter and calculates how long it will take to transfer the file. Not a big deal but it is a somewhat useful program. This program is being released into the public domain. You can use the source code any way you like as long as you leave my name in it. #!/bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'read.me' <<'END_OF_FILE' XThis is a short little program that I threw together one day out of boredom. XIt just figures the length of your file and then takes the baud rate that you Xenter and calculates how long it will take to transfer the file. Not a big Xdeal but it is a somewhat useful program. This program is being released Xinto the public domain. You can use the source code any way you like as long Xas you leave my name in it. I can be reached at the following addresses if Xyou have any desire to get in touch with me. X X ____ X / / / Amiga 1000 | Thomas "Maverick" Schwarz - Sirius Software X / / / The Machine | Box 349 Caromar Dr. Mars, PA 16046 X____ / / / That Made It | (412) 443-8916 X\ \ \/ / / Possible! | X \ \/ / / -- |UUCP: {allegra,cadre}!pitt!darth!floopy!maverick X \/_/_/ First! | or: ...uunet!nfsun!eklektik!thomas END_OF_FILE if test 894 -ne `wc -c <'read.me'`; then echo shar: \"'read.me'\" unpacked with wrong size! fi # end of 'read.me' fi if test -f 'ttime.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'ttime.c'\" else echo shar: Extracting \"'ttime.c'\" \(2520 characters\) sed "s/^X//" >'ttime.c' <<'END_OF_FILE' X/****************************************************************************** X* This program will tell you how long it will take to send a file to a remote* X* computer. All you do is give it the name of the file and the baud rate * X* that you will be sending the file at. * X******************************************************************************/ X/****************************************************************************** X* ____ * X* / / / Amiga 1000 | Thomas "Maverick" Schwarz - Sirius Software * X* / / / The Machine | Box 349 Caromar Dr. Mars, PA 16046 * X*____ / / / That Made It | (412) 443-8916 * X*\ \ \/ / / Possible! | * X* \ \/ / / -- |UUCP: {allegra,cadre}!pitt!darth!floopy!maverick * X* \/_/_/ First! | or: ...uunet!nfsun!eklektik!thomas * X******************************************************************************/ X X/**** COPYRIGHT 1990 Thomas "Maverick" Schwarz - Sirius Software ****/ X X#include X#include X#include X#include X Xstruct FileLock *mylock = NULL; Xstruct FileInfoBlock *fib = NULL; X Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ Xint success, baud; Xlong tsecs, hours, mins, secs; X X if (argv[1] == "?") X { X printf("\nUsage: TTime \n\n"); X exit(0); X } X if (argc < 2) X { X printf("\nUsage: TTime \n\n"); X exit(0); X } X baud = atoi(argv[2]); X if (baud == 0) X { X printf("\nUseage: TTime \n\n"); X exit(0); X } X if((fib = (struct FileInfoBlock *)AllocMem(sizeof(struct FileInfoBlock),MEMF_PUBLIC|MEMF_CLEAR))==NULL) X exit(0); X mylock = (struct FileLock *)Lock(argv[1],ACCESS_READ); X if(!(success = Examine(mylock,fib))) X { X printf("\n\n\nFile Not Locked!\n\n"); X FreeMem(fib,sizeof(struct FileInfoBlock)); X exit(0); X } X tsecs = ((((fib->fib_Size) *10) / baud) + (fib->fib_Size / 1920)); X hours = (tsecs / 3600); X mins = ((tsecs - 60 * hours) / 60); X secs = (tsecs - (mins * 60) - (hours * 3600)); X printf("\nTransfer time will be: %02d:%02d:%02d\n\n",hours,mins,secs); X FreeMem(fib,sizeof(struct FileInfoBlock)); X UnLock(mylock); X} END_OF_FILE if test 2520 -ne `wc -c <'ttime.c'`; then echo shar: \"'ttime.c'\" unpacked with wrong size! fi # end of 'ttime.c' fi if test -f 'ttime.uu' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'ttime.uu'\" else echo shar: Extracting \"'ttime.uu'\" \(11758 characters\) sed "s/^X//" >'ttime.uu' <<'END_OF_FILE' Xbegin 777 ttime XM```#\P`````````"``````````$```82```!%````^D```822.=^_B1()`!)N XM^0`````L>``$1_D```'H<@`@/````)I@`B;!4 XM@A^Q(``@`%'*__@B3R\)8'(I:P`Z`>QP?U*`T:P![$'K`%Q.KOZ`0>L`7$ZN+ XM_HPI0`(D+P`D0"`J`"1G$BQL`WP@0"(H```I00(<3J[_@B(J`"!G&B0\```#I XM[4ZN_^(I0`(L9PKEB"!`)V@`"`"D(&P")"\(2&P!Z"!H`"0I:``$`C!.N@)R/ XM3KH0OG``8`0@+P`$+P`@+`(49P0@0$Z03KH+EBQX``0B;`-\3J[^8DZZ`DA*- XMK`(D9QHB+`(L9P1.KO_<+'@`!$ZN_WPB;`(D3J[^AB`?+FP"*$S??WY.=61OE XM@%63KH!Z$*73KH((EA/<`*^@&P02'H!0$ZZ`=)"ETZZ"`Q83R\K``A.N@K.< XM6$\N`$J'9A!(>@%(3KH!LD*73KH'[%A/+SP``0`!2'@!!$ZZ%?Q03RE```1*^ XM@&8(0J=.N@?,6$](>/_^+RL`!$ZZ%9(I0```+JP`!"\`3KH5M$_O``Q*@&8>" XM2'H!'DZZ`6!(>`$$+RP`!$ZZ% XMN@DT+T``$"`H`'QR"DZZ"08B!TZZ"2`B+P`0T($B/```#A`O0``03KH)#'(\? XM+T``%$ZZ".(B+P`0)`&4@"`"`$$O XM+RP`!$ZZ%20NK```3KH4U$SM&(3_X$Y=3G4_``I5&TJ'9S)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AF`#Z<``O`"\`2&P!U$ALV XM`0```WPB! XM+P`(3J[_IBQ?3G5(YR`"+'D```-\3.\`!@`,3J[_FDS?0`1.=0``+PXL>0``1 XM`B!,[P`#``A.KO\Z+%].=0``+PXL>0```B`B;P`(("\`#$ZN_RXL7TYU```#= XM[`````@````!```8-```&!P``!@"```7[```%](```&R````%`````H`````, XM```#\`````-?06QL;V--96T``````!@8`````E]?0UA-,S,````+E`````)?= XM7V1R96%D````"R@````"7W-T8W5L7V0```>$`````E]#6$0S,P`````+M```1 XM``%?7W!F```1J@````)?=W)I=&4`````#90````$7U],075T;U)E<75E&ET`````!20`````E]#6$0R,@`````+Y@````)?;6]V;65M@ XM````%AP````"7U]G971B9@```!0T`````E]S=&-I7V\````'M`````)?3&]C> XM:P``````%\P````"7V5X:70```````GX`````E]?0UA-,C(````+E`````)?V XM871O:0``````#,0````"7W-T@``````````````*```````% XM````````````````````````0@``````````````````````````````````" XM`````````&0`````````````````````````````````````````````````D XM`````````````````````````````````````````(`````$```@("`@("`@D XM("`H*"@H*"`@("`@("`@("`@("`@("`@($@0$!`0$!`0$!`0$!`0$!"$A(2$0 XMA(2$A(2$$!`0$!`0$(&!@8&!@0$!`0$!`0$!`0$!`0$!`0$!`0$!$!`0$!`0" XM@H*"@H*"`@("`@("`@("`@("`@("`@("`@(0$!`0("`@("`@("`@("@H*"@H\ XM("`@("`@("`@("`@("`@("`@2!`0$!`0$!`0$!`0$!`0$(2$A(2$A(2$A(00P XM$!`0$!`0@8&!@8&!`0$!`0$!`0$!`0$!`0$!`0$!`0$0$!`0$!""@H*"@H("H XM`@("`@("`@("`@("`@("`@("`A`0$!`@```````"`/__````#@`.````````B XM%S(`````__\````$``0``````````````9C__P````0`!````````!=.````3 XM`/__````!``$````````%U@````````#[`````,````````!X```` XM10```@@````"7U]P;V]L```````,`````E]?4TE'24Y4```"#`````)?4WES1 XM0F%S90```B`````"7U]M8F%S90````'P`````E]?8G5F'0````!]`````)?3E5,3```B XM`````>@````"7U]U9F)S``````(T`````U]?4W1A8VM0='(``````B@````"H XM7V%R9V,```````/&`````E]?8W1Y<&4`````D`````-?5T)E;F-H37-G````Z XM``(D`````E]?='-I>F4````!_`````)?7VUE;'0``````!@````"7U]N=69B' XMP````!7V9I8@````0````#7U]/3D)214%+Q XM```````"&`````)?7T9015)2`````@0````"7T1/4T)A. Mail comments to the moderator at . Post requests for sources, and general discussion to comp.sys.amiga.