Ad Widget

Collapse

Check filesize of Newest file in folder

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rusteff
    Junior Member
    • Sep 2023
    • 1

    #1

    Check filesize of Newest file in folder

    I am trying to check the file size of the last file written in a folder using vfs.file.size
    I want to trigger a problem if the last file written is under 20KB
    But my attempts only seams to add upp the size of all files in the folder.
    What would the correct item and trigger be
  • SanMonitor
    Member
    • Aug 2022
    • 48

    #2
    Originally posted by rusteff
    I am trying to check the file size of the last file written in a folder using vfs.file.size
    I want to trigger a problem if the last file written is under 20KB
    But my attempts only seams to add upp the size of all files in the folder.
    What would the correct item and trigger be
    Hey rusteff,
    If the file you want to check doesn't always have the same name, you're first going to have to use something like vfs.dir.get to get all the files in this directory. Then you can use vfs.file.time to get the most recent file out of this and then finally you can use vfs.file.size to check the size of this file.

    Comment

    Working...