Kernel::System::VirtualFS - virtual filesystem lib
All virtual filesystem functions.
Don't use the constructor directly, use the ObjectManager instead:
my $VirtualFSObject = $Kernel::OM->Get('Kernel::System::VirtualFS');
read a file from virtual file system
my %File = $VirtualFSObject->Read( Filename => '/Object/some/name.txt', Mode => 'utf8', # optional DisableWarnings => 1, );
returns
my %File = ( Content => $ContentSCALAR, # preferences data Preferences => { # generated automatically FilesizeRaw => 12345, # optional ContentType => 'text/plain', ContentID => '<some_id@example.com>', ContentAlternative => 1, SomeCustomParams => 'with our own value', }, );
write a file to virtual file system
my $Success = $VirtualFSObject->Write( Content => \$Content, Filename => '/Object/SomeFileName.txt', Mode => 'binary' # (binary|utf8) # optional, preferences data Preferences => { ContentType => 'text/plain', ContentID => '<some_id@example.com>', ContentAlternative => 1, SomeCustomParams => 'with our own value', }, );
delete a file from virtual file system
my $Success = $VirtualFSObject->Delete( Filename => '/Object/SomeFileName.txt', # optional DisableWarnings => 1, );
find files in virtual file system
only for file name
my @List = $VirtualFSObject->Find( Filename => '/Object/some_what/*.txt', );
only for preferences
my @List = $VirtualFSObject->Find( Preferences => { ContentType => 'text/plain', }, );
for file name and for preferences
my @List = $VirtualFSObject->Find( Filename => '/Object/some_what/*.txt', Preferences => { ContentType => 'text/plain', }, );
Returns:
my @List = ( '/Object/some/file.txt', '/Object/my.pdf', );
This software is part of the OTRS project (https://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.