Results 1 to 3 of 3

Thread: Getting size of file

  1. #1
    Join Date
    Oct 2015
    Location
    Nowhere
    Posts
    134
    Mentioned
    2 Post(s)
    Quoted
    64 Post(s)

    Default Getting size of file

    Would I use FileSize() to get the size of a file? It's asking for an integer "FileNum", so I'm not sure what to input.

    I'm downloading video files from my security camera, and would like to delete files if the folder gets too big. What would be the best way to accomplish this? I was thinking simply reading the folder size and deleting the oldest files. But maybe there's a way to have the folder automatically overwrite if the folder gets too large? Couldn't find anything about that.

  2. #2
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by docs.villavu.com
    Files in Simba are all integers, internal handles for Simba which on their turn point to operating system files. Functions like CreateFile and OpenFile return a file handle. You should not forget to close these when you no longer need them.
    Files are represented as integers. FileSize() is expecting a variable FileNum which should be the variable (of type integer) that represents your file.
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  3. #3
    Join Date
    Oct 2015
    Location
    Nowhere
    Posts
    134
    Mentioned
    2 Post(s)
    Quoted
    64 Post(s)

    Default

    Quote Originally Posted by KeepBotting View Post
    Files are represented as integers. FileSize() is expecting a variable FileNum which should be the variable (of type integer) that represents your file.
    So files are actually contents in a folder I just found out. What I need is to find the size of a directory.. But I don't see a function for that.

    However, now I know that OpenFile() will give me an integer, so I suppose I'll just have to open all files in a directory and add it all up.

    Thanks!

    EDIT: Just tested it. It works

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •