iambumblehead / thu.sh

bash script to render thumbnails for various types of file
GNU General Public License v3.0
1 stars 0 forks source link

find a way to get a portable last modified timestamps #64

Open iambumblehead opened 3 months ago

iambumblehead commented 3 months ago

stat command is demonstrated here as not reliable across different platforms https://stackoverflow.com/questions/43223874/extract-timestamps-for-files-in-a-folder-and-compare-them-against-date-field-in

ls command is also not reliable across different platforms https://serverfault.com/questions/60269/what-is-the-alternative-to-ls-time-style-full-iso-in-bsd

iambumblehead commented 3 months ago

opinion, the script could somehow detect which variant of either command is available on the system to give initial support for mac + linux and other systems could be supported later on somehow and/or an error message could be shown if neither variant has a supported call that returns timestamp

iambumblehead commented 3 months ago

it makes no sense there are no posix solutions for getting (or working with) timestamps

iambumblehead commented 3 months ago

https://unix.stackexchange.com/questions/561927/getting-file-modification-time-in-posix-shell

iambumblehead commented 3 months ago

https://stackoverflow.com/questions/14281436/test-whether-a-command-option-is-supported