Search Unity

Free bytes reported by caching api is astronomical

Discussion in 'Editor & General Support' started by nilsk123, Aug 16, 2017.

  1. nilsk123

    nilsk123

    Joined:
    Dec 13, 2016
    Posts:
    19
    Hello,

    Before downloading files/assetbundles to the local cache i'd like to check for free disk space. I found the spacefree property which should return the amount of writable bytes in a long:

    https://docs.unity3d.com/ScriptReference/Cache-spaceFree.html

    I call it as follows:

    Caching.currentCacheForWriting.spaceFree;

    This however always returns an astronomical number, on my laptop it sais I have close to a million terrabyte of free storage :eek: The spaceOccupied does seem to return the actual number of bytes currently written to the cache.

    Can anyone make sense of this?