File Services

class FileServices(Capability)

This class provides the capability to read from and write to file objects.

do_AtomicReadFileRequest(apdu)
Parameters:apdu (AtomicReadFileRequest) – request from the network

This method looks for a local file object by the object identifier and and passes the request parameters to the implementation of the record or stream support class instances.

do_AtomicWriteFileRequest(apdu)
Parameters:apdu (AtomicWriteFileRequest) – request from the network

This method looks for a local file object by the object identifier and and passes the request parameters to the implementation of the record or stream support class instances.

Support Classes

class LocalRecordAccessFileObject(FileObject)

This abstract class provides a simplified API for implementing a local record access file. A derived class must provide implementations of these methods for the object to be used by the FileServices.

__len__()

Return the length of the file in records.

read_record(start_record, record_count)
Parameters:
  • start_record (int) – starting record
  • record_count (int) – number of records

Return a tuple (eof, record_data) where the record_data is an array of octet strings.

write_record(start_record, record_count, record_data)
Parameters:
  • start_record (int) – starting record
  • record_count (int) – number of records
  • record_data – array of octet strings

Update the file with the new records.

class LocalStreamAccessFileObject(FileObject)

This abstract class provides a simplified API for implementing a local stream access file. A derived class must provide implementations of these methods for the object to be used by the FileServices.

__len__()

Return the length of the file in octets.

read_stream(start_position, octet_count)
Parameters:
  • start_position (int) – starting position
  • octet_count (int) – number of octets

Return a tuple (eof, record_data) where the record_data is an array of octet strings.

write_stream(start_position, data)
Parameters:
  • start_position (int) – starting position
  • data – octet string

Update the file with the new records.

class FileServicesClient(Capability)

This class adds a set of functions to the application that provides a simplified client API for reading and writing to files. It is not currently implemented.