Skip to content

truncate does not work on file opened by another process #76

Open
@mmatczuk

Description

@mmatczuk

The way truncating is implemented does not work when file is open by another process.

VERBOSE: Truncating C:\sauce-connect\logs\sc.log
Process-Local-Block : Exception calling "RotateMainOnly" with "0" argument(s): "Exception calling "WriteAllText" with "2" argument(s
): "Proces nie może uzyskać dostępu do pliku „C:\sauce-connect\logs\sc.log”, ponieważ jest on używany przez inny proces.""
At C:\Program Files\WindowsPowerShell\Modules\Log-Rotate\1.6.1\public\Log-Rotate.ps1:207 char:13
+             Process-Local-Block -block $block @blockoptions
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], MethodInvocationException
    + FullyQualifiedErrorId : ScriptMethodRuntimeException,Process-Local-Block

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions