On 15.04.22 23:54, gc394625 wrote:
Hi,
Actually I'm using wget-1.21.3-win32/64 and I have (since long) a
weird problem :
I have an "old" Thecus N2100 NAS and a "less old" Netgear RN102
(newest Firmware). They are used in Windows with their UNC
(\\NAS\Folder\....).
*Netgear RN102:*
When downloading files from the Internet with WGET,*the original
Date/Time stamp of the files is lost* (it becomes the
download-Date/Time). To be clear, this only concerns WGET !
Windows-copies keep the original Date/Time !
*Thecus N2100:*
Simultaneous downloading of the same files (same PC, same WGET) to
the Thecus *will retain the original Date/Time* like it's done also
on a normal PC-drive.
Same known behaviour since WinXP upto actual Win10.
I have never been able to find a solution for the Netgear, so
actually couldn't use it for all my needs.
What is WGET doing after the file has been downloaded to set the
correct Date/time (on the Thecus)
What could be the reason ?
(How) can I solve this ?
Any experinces with other NAS-brands in combination with WGET ?
This Date/Time behaviour is crucial for me for purchasing a new NAS
!!! It MUST work.
Thanks for helping
Kind regards
Walter
Hi,
are you sure that both directories (on the two different NASes) have
exactly the same permissions ? Maybe also check that both have the
same file system (I can only guess that both use NTFS, but I am not a
Win expert).
Then make sure that you have the latest wget, best from
https://eternallybored.org/misc/wget/
The code to set the file time is in src/utils.c:
/* "Touch" FILE, i.e. make its mtime ("modified time") equal the time
specified with TM. The atime ("access time") is set to the current
time. */
void
touch (const char *file, time_t tm)
{
struct utimbuf times;
times.modtime = tm;
times.actime = time (NULL);
if (utime (file, ×) == -1)
logprintf (LOG_NOTQUIET, "utime(%s): %s\n", file, strerror (errno));
}
'utime()' on Windows is emulated by gnulib - so there is a chance that
the latest wget works differently as it contains a newer gnulib code.
But if utime() fails, you should see that log output.
The gnulib Windows emulation code is in lib/utime.c, if you are
interested in the details.
Regards, Tim