Hey guys,
This bounced for me, so I guess (no surprise) his email address
isn't current. I doubt he's really interested [last updated in 2001],
but feel free to ping him for me if you know how to contact him.
---------- Forwarded message ----------
From: Rugxulo <rugxulo@gmail>
Date: Sat, Oct 12, 2013 at 7:15 PM
Subject: REPLACE 1.2 (incorrect setftime usage)
To: rene.ableidinger@bogus
I think there's a bug in REPLACE regarding usage of setftime, it won't
preserve the timestamp correctly. Well, just now testing, it works
properly under DOSEMU (go figure), but I swear in real native FreeDOS
it does not. Feel free to confirm!
P.S. I do not have Borland C, and while this (thankfully) compiles in
DJGPP, I cannot rebuild it (without some stub functions) in TC201,
TCPP101, nor OpenWatcom19. For TurboC++, the main problem is lacking
_fullpath (similar to "truename"?). OpenWatcom has more
incompatibilities but probably? can be worked around somehow with
minor tweaks (or bits from Blair's libc).
========================================
--- replace.old 2001-03-25 11:08:20 +0000
+++ replace.c 2013-10-12 18:43:46 +0000
@@ -526,6 +526,24 @@
buffersize = fread(buffer, sizeof(char), BUFSIZ, src_file);
}
+#ifdef BUGFIX
+ /*
+ DJGPP's "info libc a setftime" says this:
+
+ since writing to a file and closing a file
+ opened for writing also sets the modification
+ time, you should only use this function on files
+ opened for reading.
+ */
+
+ /* close files */
+ fclose(src_file);
+ fclose(dest_file);
+
+ src_file = fopen(src_filename, "rb");
+ dest_file = fopen(dest_filename, "rb");
+#endif
+
/* copy file timestamp */
getftime(fileno(src_file), &filetime);
setftime(fileno(dest_file), &filetime);
========================================
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel