How to get file size under Lua/

Discussion in 'Programming' started by jimmyking, Feb 29, 2024.

  1. jimmyking

    jimmyking
    Expand Collapse

    Joined:
    Mar 9, 2020
    Messages:
    47
    its possable as its under lua/ge/ge_utils


    ill have already tried to use it but failed as I can't get it to take a file path like
    filename = "D:/Program Files/steam/steamapps/common/BeamNG.drive/lua/vehicle/hydros.lua"
    then if I tried printing f I got nil

    or am i doing something wrong? :thinking emoji:
     
    #1 jimmyking, Feb 29, 2024
    Last edited: Feb 29, 2024
  2. SineMatic

    SineMatic
    Expand Collapse

    Joined:
    Nov 17, 2022
    Messages:
    44
    Only BeamNG.drive directory is exposed to the game engine. So try using lua/vehicle/hydros.lua path instead
     
    • Agree Agree x 1
  3. jimmyking

    jimmyking
    Expand Collapse

    Joined:
    Mar 9, 2020
    Messages:
    47
    thanks, I got it working with
     
    • Like Like x 1
  4. vulcan-dev

    vulcan-dev
    Expand Collapse

    Joined:
    Jan 28, 2017
    Messages:
    245
    Just a quick heads up, io operations can be quite slow, so try to avoid doing it every update. Glad to see you've got it working though
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice