Type [Function][ap i.type.Function] Return value [Bool ean]api.type.Boolean Revision [Release 2025.3721](https://solar2d.com/download/) Keywords steam, st eamworks, deleteFile, cloud storage See also [steamwor ks.*]plugin.steamworks, steamworks.writeFile, steamworks.fileExists
This function deletes a file from Steam Cloud storage. It returns true
if the file was successfully deleted, false
otherwise.
This API is only available on 2025.3722+
When a file is deleted from Steam Cloud, the deletion is synchronized across all devices where the user has the game installed. The file will be permanently removed from cloud storage.
It’s recommended to check if a file exists using steamworks.fileExists()
before attempting to delete it to avoid unnecessary operations.
steamworks.deleteFile( filename )
Boolean. Returns true
if the file was successfully deleted from Steam Cloud, false
if the operation failed or the file doesn’t exist.
local steamworks = require( "plugin.steamworks" ) local function deletePlayerData() if steamworks.fileExists("playerData.json") then if steamworks.deleteFile("playerData.json") then print("Player data deleted from Steam Cloud.") else print("Failed to delete player data.") end else print("No file to delete.") end end -- Call the delete function deletePlayerData()