SMB::OpenFile - A state of opening local or remote file for SMB
use SMB::File; # for server, on Create request my $file = SMB::File->new( name => $create_request->file_name, share_root => $tree->root, is_ipc => $tree->is_ipc, ); my $openfile = $file->supersede; # or: create, open, overwrite etc $openfile->close; $openfile = $file->open_by_disposition(SMB::File::DISPOSITION_OPEN_IF); # for client, on Create response my $file = $create_response->openfile->file;
This class implements an SMB open-file abstraction, mainly for a server.
This class inherits from SMB, so msg, err, mem, dump, auto-created field accessor and other methods are available as well.
- new FILE HANDLE ACTION [OPTIONS]
Class constructor. Creates an instance of SMB::OpenFile.
Performs the opposite operation to the constructor.
- read OPTIONS
For openfile corresponding to the local file (having the actual HANDLE) performs the read operation according to the OPTIONS hash values.
The OPTIONS keys are offset, length and minlen. Option length is mandatory (may be 0), the others are optional and default to 0.
On success, the buffer of length or less bytes being read starting from offset is returned. On error (or if lesser than minlen bytes were read from file HANDLE), undef is returned.
Mikhael Goikhman <email@example.com>