Using read0 we are able to get the contents of a file
Is it possible to get a file’s creation time? but without using system commands like :
\ls -l
\stat
Using read0 we are able to get the contents of a file
Is it possible to get a file’s creation time? but without using system commands like :
\ls -l
\stat
I notice in your example leading backslash examples; perhaps your issue is their flexibility where you could instead use the **system **command e.g.
system “ls -l”
Any reason you can’t use system commands?
Thanks for your reply David.
Using ‘system’ is the last resort, (1) it makes the code platform dependent, (2) would be lot slower since it will have to spin up a process to run the command. (3) But the main reason is, I feel system command is a hole in security, it can be misused, in production ideally should it be blocked using command line option -u
If there is no built-in fast and safe way, I suggest kx to introduce a stat command for this purpose
This might be easier for you to encode creation time into filename or even into structure of directory tree. You may also consider implementing a DLL of Stat API for effectiveness (suppose you’re on Windows, because Linux doesn’t keep track of the creation time since it is not required by POSIX). Latter platform dependent choice has a little advantage to ‘system’ command.