1. Anders Ruud
  2. love
  3. Issues


Issue #541 resolved

love.filesystem.append and love.filesystem.getSize?

created an issue

I noticed that File objects can be opened in append mode and have a getSize method, but these things can't be done with love.filesystem functions.

Would it be useful to have love.filesystem.append(filename, string) and love.filesystem.getSize(filename) as well?

Edit: I guess this already gets the size of a file:

_, size = love.filesystem.read('file.txt')

Another edit: But I assume that would take longer, because it's being read.

Comments (6)

  1. hahawoo reporter

    I'm not sure if these are useful reasons, but...

    • Loading audio files differently (streaming or static) depending on their size
    • A file browser maybe?
    • Only loading a file if it's below a certain size
    • Estimating how long it will take for a resource to load based on its size, maybe for a more accurate "percent loaded" display (which might not be so useful depending on how fast checking the size would be)
  2. Alex Szpakowski

    Apparently if you do love.filesystem.write(filename, data, size, 3) it will write in append mode. This is due to an unfinished addition to love.filesystem.write's code.

    It makes more sense to me if love.filesystem.append and love.filesystem.write would be separated though.

  3. Log in to comment