I have an old dos program of mine which I want to convert to linux.
Its in Borland C. It creates a unique name based on the systems current
date and time not an offset from 1970 but the current MMDDYY HHMMSS.
I beleive tis best left as C but some of the routines I remember being
Borland specific would need to be rewritten. This is a first effort for
me in Unix and I would like help from the list as I can not afford books
at this time.
Though once I used it stand alone its best called from a script which
passes it file names one at a time.
Here is the Code sorry about the line length.
/*
------------------------------------------------------------------------- */
/* UNIQUENA a program to rename a given file or set thereof by encoding
the */
/* date and time from the system. Should the time be zero that section
will */
/* rerun until a non zero result is obtained. This program will handle
wild */
/* cards and multiple files listed. see OVERWRIT & PUBLIC
*/
/* prog by Carl William Spitzer IV
*/
/*
------------------------------------------------------------------------- */
/*struct date
*/
/* int da_year; current year
*/
/* char da_day; day of the month
*/
/* char da_mon; month (1 = Jan)
*/
/*
*/
/*struct time
*/
/* unsigned char ti_min; minutes
*/
/* unsigned char ti_hour; hours
*/
/* unsigned char ti_hund; hundredths of seconds
*/
/* unsigned char ti_sec; seconds
*/
/* ----------------------- function prototype section
---------------------- */
void main( int argc, char *argv[] );
void UniqueName( char *);
/* ------------------------ preprocessor statements
------------------------ */
#include