Data ONTAP® PowerShell Toolkit

Cmdlet: Set-NaFileSize


NAME
Set-NaFileSize

SYNOPSIS
Truncate a file.

SYNTAX
Set-NaFileSize [-Path] <String> [[-Size] <Int64>] [-Controller <NaController
>] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [-WhatIf]
[-Confirm] [<CommonParameters>]


DESCRIPTION
Truncate a file. Any data past the truncation point will be lost.


PARAMETERS
-Path <String>
Path of the file, i.e. /vol/<volumename>/<filename>.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false

-Size <Int64>
If provided, the file size is set to this value. The default value is 0.

Required? false
Position? 2
Default value 0
Accept pipeline input? false
Accept wildcard characters? false

-Controller <NaController>
The DataONTAP controller object, embodied by an NaController object. Th
is parameter is returned by the Connect-NaController cmdlet. If not spe
cified, the value in the global variable CurrentNaController is used.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WarningAction <ActionPreference>


Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WarningVariable <String>


Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WhatIf


Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Confirm


Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
NetApp.Ontapi.Filer.File.FileInfo


NOTES


Category: file
API: file-truncate-file

-------------- Example 1 --------------

C:\PS>Set-NaFileSize /vol/vol0/etc/testfile


Truncate file 'testfile' in /etc to zero length.


AccessedTimestamp : 1273090709
AclType : nt_acl
ChangedTimestamp : 1273090723
CreationTimestamp : 1273090709
FileSize : 0
FileType : file
GroupId : 0
HardLinksCount : 1
InodeNumber : 3784340
IsEmpty :
ModifiedTimestamp : 1273090723
Name : /vol/vol0/etc/testfile
OwnerId : 0
Perm : 1070
IsEmptySpecified : False



RELATED LINKS
Get-NaFile







 Data ONTAP® PowerShell Toolkit