published on Thursday, Aug 20, 2026 by jschady
published on Thursday, Aug 20, 2026 by jschady
A Lock can be used by your custom-developed applications to implement file locking and concurrency features. These locks are advisory, meaning that while a lock can be created, it does not prevent other API requests from being processed concurrently. You are responsible for checking locks prior to accessing a file.
The lock feature is designed to emulate the locking functionality provided by WebDAV. For a deeper understanding of how the lock mechanism works, refer to the WebDAV specification, which outlines how these endpoints function.
Files.com’s WebDAV offering and desktop app leverage this locking API to manage concurrent file operations, ensuring consistency when multiple users or systems interact with the same files. It is not used within the Files.com web interface.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as filescom from "pulumi-filescom";
const exampleLock = filescom.getLock({
path: "locked_file",
});
import pulumi
import pulumi_filescom as filescom
example_lock = filescom.get_lock(path="locked_file")
package main
import (
"github.com/jschady/pulumi-filescom/sdk/go/filescom"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := filescom.GetLock(ctx, &filescom.LookupLockArgs{
Path: "locked_file",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Filescom = Jschady.Filescom;
return await Deployment.RunAsync(() =>
{
var exampleLock = Filescom.GetLock.Invoke(new()
{
Path = "locked_file",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.filescom.FilescomFunctions;
import com.pulumi.filescom.inputs.GetLockArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var exampleLock = FilescomFunctions.getLock(GetLockArgs.builder()
.path("locked_file")
.build());
}
}
variables:
exampleLock:
fn::invoke:
function: filescom:getLock
arguments:
path: locked_file
pulumi {
required_providers {
filescom = {
source = "pulumi/filescom"
}
}
}
data "filescom_getlock" "exampleLock" {
path = "locked_file"
}
Using getLock
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getLock(args: GetLockArgs, opts?: InvokeOptions): Promise<GetLockResult>
function getLockOutput(args: GetLockOutputArgs, opts?: InvokeOutputOptions): Output<GetLockResult>def get_lock(path: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetLockResult
def get_lock_output(path: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetLockResult]func LookupLock(ctx *Context, args *LookupLockArgs, opts ...InvokeOption) (*LookupLockResult, error)
func LookupLockOutput(ctx *Context, args *LookupLockOutputArgs, opts ...InvokeOption) LookupLockResultOutput> Note: This function is named LookupLock in the Go SDK.
public static class GetLock
{
public static Task<GetLockResult> InvokeAsync(GetLockArgs args, InvokeOptions? opts = null)
public static Output<GetLockResult> Invoke(GetLockInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetLockResult> Invoke(GetLockInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetLockResult> getLock(GetLockArgs args, InvokeOptions options)
public static Output<GetLockResult> getLock(GetLockArgs args, InvokeOptions options)
public static Output<GetLockResult> getLock(GetLockArgs args, InvokeOutputOptions options)
fn::invoke:
function: filescom:index/getLock:getLock
arguments:
# arguments dictionarydata "filescom_get_lock" "name" {
# arguments
}The following arguments are supported:
- Path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- Path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- path String
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- path str
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- path String
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
getLock Result
The following output properties are available:
- Allow
Access boolBy Any User - Can lock be modified by users other than its creator?
- Depth string
- Exclusive bool
- Is lock exclusive?
- Owner string
- Owner of the lock. This can be any arbitrary string.
- Path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- Recursive bool
- Does lock apply to subfolders?
- Scope string
- Timeout int
- Lock timeout in seconds
- Token string
- Lock token. Use to release lock.
- Type string
- User
Id int - Lock creator user ID
- Username string
- Lock creator username
- Allow
Access boolBy Any User - Can lock be modified by users other than its creator?
- Depth string
- Exclusive bool
- Is lock exclusive?
- Owner string
- Owner of the lock. This can be any arbitrary string.
- Path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- Recursive bool
- Does lock apply to subfolders?
- Scope string
- Timeout int
- Lock timeout in seconds
- Token string
- Lock token. Use to release lock.
- Type string
- User
Id int - Lock creator user ID
- Username string
- Lock creator username
- allow_
access_ boolby_ any_ user - Can lock be modified by users other than its creator?
- depth string
- exclusive bool
- Is lock exclusive?
- owner string
- Owner of the lock. This can be any arbitrary string.
- path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- recursive bool
- Does lock apply to subfolders?
- scope string
- timeout number
- Lock timeout in seconds
- token string
- Lock token. Use to release lock.
- type string
- user_
id number - Lock creator user ID
- username string
- Lock creator username
- allow
Access BooleanBy Any User - Can lock be modified by users other than its creator?
- depth String
- exclusive Boolean
- Is lock exclusive?
- owner String
- Owner of the lock. This can be any arbitrary string.
- path String
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- recursive Boolean
- Does lock apply to subfolders?
- scope String
- timeout Integer
- Lock timeout in seconds
- token String
- Lock token. Use to release lock.
- type String
- user
Id Integer - Lock creator user ID
- username String
- Lock creator username
- allow
Access booleanBy Any User - Can lock be modified by users other than its creator?
- depth string
- exclusive boolean
- Is lock exclusive?
- owner string
- Owner of the lock. This can be any arbitrary string.
- path string
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- recursive boolean
- Does lock apply to subfolders?
- scope string
- timeout number
- Lock timeout in seconds
- token string
- Lock token. Use to release lock.
- type string
- user
Id number - Lock creator user ID
- username string
- Lock creator username
- allow_
access_ boolby_ any_ user - Can lock be modified by users other than its creator?
- depth str
- exclusive bool
- Is lock exclusive?
- owner str
- Owner of the lock. This can be any arbitrary string.
- path str
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- recursive bool
- Does lock apply to subfolders?
- scope str
- timeout int
- Lock timeout in seconds
- token str
- Lock token. Use to release lock.
- type str
- user_
id int - Lock creator user ID
- username str
- Lock creator username
- allow
Access BooleanBy Any User - Can lock be modified by users other than its creator?
- depth String
- exclusive Boolean
- Is lock exclusive?
- owner String
- Owner of the lock. This can be any arbitrary string.
- path String
- Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
- recursive Boolean
- Does lock apply to subfolders?
- scope String
- timeout Number
- Lock timeout in seconds
- token String
- Lock token. Use to release lock.
- type String
- user
Id Number - Lock creator user ID
- username String
- Lock creator username
Package Details
- Repository
- filescom jschady/pulumi-filescom
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
filescomTerraform Provider.
published on Thursday, Aug 20, 2026 by jschady