A a file with this content. The size of the content is limited to 1024 characters.
↳ path
string
Required. The absolute path of the file within the VM.
↳ state
int
Required. Desired state of the file.
↳ permissions
string
Consists of three octal digits which represent, in order, the permissions of the owner, group, and other users for the file (similarly to the numeric mode used in the linux chmod utility). Each digit represents a three bit number with the 4 bit corresponding to the read permissions, the 2 bit corresponds to the write bit, and the one bit corresponds to the execute permission. Default behavior is 755. Below are some examples of permissions and their associated values: read, write, and execute: 7 read and execute: 5 read and write: 6 read only: 4
The size of the content is limited to 1024 characters.
Returns
Type
Description
string
hasContent
setContent
A a file with this content.
The size of the content is limited to 1024 characters.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getPath
Required. The absolute path of the file within the VM.
Returns
Type
Description
string
setPath
Required. The absolute path of the file within the VM.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getState
Required. Desired state of the file.
Returns
Type
Description
int
setState
Required. Desired state of the file.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getPermissions
Consists of three octal digits which represent, in
order, the permissions of the owner, group, and other users for the
file (similarly to the numeric mode used in the linux chmod
utility). Each digit represents a three bit number with the 4 bit
corresponding to the read permissions, the 2 bit corresponds to the
write bit, and the one bit corresponds to the execute permission.
Default behavior is 755.
Below are some examples of permissions and their associated values:
read, write, and execute: 7
read and execute: 5
read and write: 6
read only: 4
Returns
Type
Description
string
setPermissions
Consists of three octal digits which represent, in
order, the permissions of the owner, group, and other users for the
file (similarly to the numeric mode used in the linux chmod
utility). Each digit represents a three bit number with the 4 bit
corresponding to the read permissions, the 2 bit corresponds to the
write bit, and the one bit corresponds to the execute permission.
Default behavior is 755.
Below are some examples of permissions and their associated values:
read, write, and execute: 7
read and execute: 5
read and write: 6
read only: 4
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud OsConfig V1 Client - Class FileResource (2.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.0 (latest)](/php/docs/reference/cloud-osconfig/latest/V1.OSPolicy.Resource.FileResource)\n- [2.0.5](/php/docs/reference/cloud-osconfig/2.0.5/V1.OSPolicy.Resource.FileResource)\n- [1.3.5](/php/docs/reference/cloud-osconfig/1.3.5/V1.OSPolicy.Resource.FileResource)\n- [1.2.2](/php/docs/reference/cloud-osconfig/1.2.2/V1.OSPolicy.Resource.FileResource)\n- [1.1.1](/php/docs/reference/cloud-osconfig/1.1.1/V1.OSPolicy.Resource.FileResource)\n- [1.0.5](/php/docs/reference/cloud-osconfig/1.0.5/V1.OSPolicy.Resource.FileResource) \nReference documentation and code samples for the Google Cloud OsConfig V1 Client class FileResource.\n\nA resource that manages the state of a file.\n\nGenerated from protobuf message `google.cloud.osconfig.v1.OSPolicy.Resource.FileResource`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ OsConfig \\\\ V1 \\\\ OSPolicy \\\\ Resource\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getFile\n\nA remote or local source.\n\n### hasFile\n\n### setFile\n\nA remote or local source.\n\n### getContent\n\nA a file with this content.\n\nThe size of the content is limited to 1024 characters.\n\n### hasContent\n\n### setContent\n\nA a file with this content.\n\nThe size of the content is limited to 1024 characters.\n\n### getPath\n\nRequired. The absolute path of the file within the VM.\n\n### setPath\n\nRequired. The absolute path of the file within the VM.\n\n### getState\n\nRequired. Desired state of the file.\n\n### setState\n\nRequired. Desired state of the file.\n\n### getPermissions\n\nConsists of three octal digits which represent, in\norder, the permissions of the owner, group, and other users for the\nfile (similarly to the numeric mode used in the linux chmod\nutility). Each digit represents a three bit number with the 4 bit\ncorresponding to the read permissions, the 2 bit corresponds to the\nwrite bit, and the one bit corresponds to the execute permission.\n\nDefault behavior is 755.\nBelow are some examples of permissions and their associated values:\nread, write, and execute: 7\nread and execute: 5\nread and write: 6\nread only: 4\n\n### setPermissions\n\nConsists of three octal digits which represent, in\norder, the permissions of the owner, group, and other users for the\nfile (similarly to the numeric mode used in the linux chmod\nutility). Each digit represents a three bit number with the 4 bit\ncorresponding to the read permissions, the 2 bit corresponds to the\nwrite bit, and the one bit corresponds to the execute permission.\n\nDefault behavior is 755.\nBelow are some examples of permissions and their associated values:\nread, write, and execute: 7\nread and execute: 5\nread and write: 6\nread only: 4\n\n### getSource"]]