From 74a4d8c26dd3c1e9febcb717cfd6cb6512991a7a Mon Sep 17 00:00:00 2001 From: "Charles.Forsyth" Date: Fri, 22 Dec 2006 21:39:35 +0000 Subject: 20060303 --- utils/format/Nt.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 utils/format/Nt.c (limited to 'utils/format/Nt.c') diff --git a/utils/format/Nt.c b/utils/format/Nt.c new file mode 100644 index 00000000..f2239f3c --- /dev/null +++ b/utils/format/Nt.c @@ -0,0 +1,47 @@ +#include + +int +initfflag() +{ + return 1; +} + +Tm * +getlocaltime() +{ + static Tm tmstruct; + + time_t t = time((time_t *)0); + struct tm *ts = localtime(&t); + Tm *tt = &tmstruct; + + tt->hour = ts->tm_hour; + tt->min = ts->tm_min; + tt->sec = ts->tm_sec; + tt->year = ts->tm_year; + tt->mon = ts->tm_mon; + tt->mday = ts->tm_mday; + tt->wday = ts->tm_wday; + tt->yday = ts->tm_yday; + return tt; +} + +int +openfloppy(char *dev) +{ + char buf[16]; + + /* if dev is of the form "x:" use "\\.\x:" instead */ + if (strlen(dev) == 2 && dev[1] == ':') { + if (dev[0] == 'a' || dev[0] == 'A') { + strcpy(buf, "\\\\.\\"); + strcat(buf, dev); + return open(buf, ORDWR); + } + else { + print("can only open A: drive\n"); + return -1; + } + } + return open(dev, ORDWR); +} -- cgit v1.2.3