steamworks.deleteFile

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

Overview

This function deletes a file from Steam Cloud storage. It returns true if the file was successfully deleted, false otherwise.

Important

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.

Syntax

steamworks.deleteFile( filename )

Parameters

  • filename (required): String. The name of the file to delete from Steam Cloud storage.

Return Value

Boolean. Returns true if the file was successfully deleted from Steam Cloud, false if the operation failed or the file doesn’t exist.

Example

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()