I don't find a way to check the free space available in a device using Haxe, Openfl, Lime or another library. I would like to avoid download data that will exceed the size recommended for an app in each device. What do you do to check that?
How to check the available free space in Haxe?
208 Views Asked by ccsakuweb At
1
There are 1 best solutions below
Related Questions in HAXE
- Haxe: Custom Sphere x Box collision, from same size lengths to dynamic w,h,l (Haxe, OpenFL)
- How can I execute the command “run lime setup” and “run openfl setup” from haxeflixel, on a macbook pro m1 Max, without getting an error?
- Is it possible to globally modify the AST in Nim?
- Using Haxe, how can I generate python code with type hints?
- Opening and using DLL created with HXCPP
- Counter that shows only at the end in HaxeFlixel
- FlxG.overlap doesen't work correctly when changing angle of an object
- Running libraries with Haxelib leads to `Module not found`, printing out a path containing ^'s
- How do I remove FLX trail or change it's parent object or image?
- sys.io.File.saveContent and sys.FileSystem.deleteFile failing for unknown reasons
- Haxe: get path to the `std` library
- Haxe convert fnt to bfnt?
- How change the icon on the game?
- Generate function by its arguments and internal call arguments on a HAXE
- What causes Haxe error "Invalid build parameters"
Related Questions in OPENFL
- Haxe: Custom Sphere x Box collision, from same size lengths to dynamic w,h,l (Haxe, OpenFL)
- Can I do a color swap like Among Us in OpenFL?
- How to set initial size of OpenFL window on native targets, while allowing the html5 target fill the entire browser window?
- Creating a second game window in HaxeFlixel
- How do I put a camera on a separate window without lag?
- Ignore transparent pixels on sprite
- How to directly save a BitmapData as a PNG file without any dialog
- Spawn Sprites on Desktop [Haxe Flixel]
- Haxe / Openfl/ Is it possible to load a video (.mp4) from the Assets file and display it in the stage?
- What meaning this haxe error:Normal variables cannot be accessed with 'super', use 'this' instead
- How to translate the namespace of AS3 to haxe?
- How to read XML Attributes in Haxe?
- Haxe can implement multi interfaces?
- Intel OpenFL - RuntimeError: mat1 and mat2 shapes cannot be multiplied (128x512 and 2048x4096)
- How to create html with openfl?
Related Questions in LIME-HAXE
- How do I remove FLX trail or change it's parent object or image?
- I cant compile psych engine because of this error
- FNF Psych Engine Slow Down (Friday Night Funkin') lime test windows
- I can't run the last command of Kade Engine. It errors
- (Friday Night Funkin') Problem when running "lime test windows"
- What could cause website content to work when hosted online but not when locally downloaded?
- Lime in Visual Studio Code - setup failed
- Why my rebuilded openfl/lime 2.9.1 for haxeflixel always ingores my own androidmanifest uses permissions?
- Haxe: openfl test works but not lime build
- Getting Error loading templates, please run 'flixel download'.?
- return-statement with no value in function returning void: HxScout with openfl
- HaxeUI library not working with Lime/openFL/Haxe
- Workaround to lime-legacy not providing access to lime classes
- Deploying HaxeFlixel game to Android device
- Lime samples won't compile
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Try creating a file of that size! Then either delete it or reopen and write (not append) over its contents.
I don't know whether all platforms Haxe supports will work fine with this trick, but this algorithm is reported to work in many places and languages (I personally tested it in Ruby and saw the same suggestion for C++/.NET). To check whether X bytes of disk space are available:
opena new file for writingseekX-1 bytes from the beginningwritea byte of data (whatever you want,0,42...)closethe file (probably unrelated to the task at hand, but don't forget to do that anyway)If there's insufficient disk space, you'll likely get an exception at some point in this algorithm. You'll have to find out what errors to expect and process them properly.
Using
ihxI've found this is working and requires nothing but Haxe Standard Library:After these manipulations, I had a file named
locaof exactly 40000 bytes in my working directory.By the way, be careful when doing things like these in
ihxsince it re-runs the entire session with the last entered line appended each time.Ongoing experimentation:
However, when there's insufficient disk space, it may not fail with errors. In this case you'll have to check the real size with
sys.FileSystem.stat(path).size. And don't forget to delete the file if there's not enough space.