05-03-2025, 02:04 AM
(This post was last modified: 05-03-2025, 02:10 AM by hsiangch_ong.)
(05-02-2025, 05:10 PM)madscijr Wrote: I figured out how to do it in PowerShell (code below) but both that and WMIC seem to be Windows-specific,
and it makes me curious, is there a platform-independent way to get a file's modified date?
I would think that getting a file's attributes would be something we'd all want on any platform?
the problem is that it was ridiculously easy to get the date and time of anything. to change it at will. for the sake of some shareware programs to use them longer. on ms-dos and on earlier versions of windows.
but with this need for security. for this need to timestamp packages before they are installed. and other reasons. things began being restricted with doing things with the date and time. i intensely dislike on linux, being asked for my password when i have to change the date and time. now i'm on a computer where i need to replace the cmos chip. so i have to do one of two things after i turn on. change the date and time manually. or do a kludge to get it from internet. because "ntpdig" in one of my systems is broken. i don't want to connect to internet before turning on the computer and risking "systemd" doing something i didn't authorize it to do. so i have this peeve of mine attacking me regularly.
therefore, there will not be a "platform independent" way of doing things with the date and time of files. deal with it.
besides, a solution was just offered. at least for the top three platforms. might have to change it a little for freebsd. or solaris. or reactos. or redoxos. or other weird thing like that.
Quote:this has to be a missing chr$(0) somewhere.Code: (Select All)'WHY DOES THIS RETURN A BUNCH OF JUNK WITH THE FILE?: raw$ = _ReadFile$(FileIn$)