CopyFileRange Event

Fires when the OS needs to copy a range of data from one file to another.

Syntax

// FUSECopyFileRangeEventArgs carries the FUSE CopyFileRange event's parameters.
type FUSECopyFileRangeEventArgs struct {...}

func (args *FUSECopyFileRangeEventArgs) PathIn() string
func (args *FUSECopyFileRangeEventArgs) FileContextIn() int32
func (args *FUSECopyFileRangeEventArgs) OffsetIn() int64
func (args *FUSECopyFileRangeEventArgs) PathOut() string
func (args *FUSECopyFileRangeEventArgs) FileContextOut() int32
func (args *FUSECopyFileRangeEventArgs) OffsetOut() int64
func (args *FUSECopyFileRangeEventArgs) Size() int64
func (args *FUSECopyFileRangeEventArgs) Flags() int32
func (args *FUSECopyFileRangeEventArgs) Result() int32
func (args *FUSECopyFileRangeEventArgs) SetResult(value int32)

// FUSECopyFileRangeEvent defines the signature of the FUSE CopyFileRange event's handler function.
type FUSECopyFileRangeEvent func(sender *FUSE, args *FUSECopyFileRangeEventArgs)

func (obj *FUSE) GetOnCopyFileRangeHandler() FUSECopyFileRangeEvent
func (obj *FUSE) SetOnCopyFileRangeHandler(handlerFunc FUSECopyFileRangeEvent)

Remarks

Windows:

This event is currently not used.

Linux:

This event fires when the OS needs to copy a range of data from one file to another. The source file is identified either by PathIn or FileContextIn. The destination file is identified either by PathOut or FileContextOut.

OffsetIn specifies the starting offset in the source file from which the data is taken.

OffsetOut specifies the starting offset in the destination file, to which the data should be written.

Size specifies the size of the data block to be copied.

Flags is provided for future extensions and is currently not used.

The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource isn't available, security checks failed, etc.), set it to a negative error code value (e.g. -ENOENT to indicate that the file does not exist) to report an appropriate error. Please refer to the Error Reporting and Handling topic for more information.

Copyright (c) 2022 Callback Technologies, Inc. - All rights reserved.
CBFS FUSE 2020 Go Edition - Version 20.0 [Build 8348]