DEENESPTFRRUARHIKOZHNL

класс ara::per::FileStorage

[SWS_PER_00340] Upstream: RS_PER_00004, RS_AP_00122, RS_AP_00140, RS_AP_00146

class FileStorage final {...};

The File Storage contains a set of files identified by their file names.

Header-Datei#include "ara/per/file_storage.h"
Forwarding-Header#include "ara/per/per_fwd.h"
Scopenamespace ara::per

Руководство пользователяСОЗДАНО ИИ

Управляет персистентными файлами и открывает их через дескрипторы на основе RAII для блочного чтения и записи.
СОЗДАНО ИИ не проверено Модель: gemini-3.8-flash-medium · Усилие: medium · Температура: не регулируется · Промпт: 7736cf7ccbd1 Происхождение Открытые вопросы (2)
переведено с немецкого руководстваgemini-3.8-flash-low · 2026-10-13 · Немецкий оригинал

Управляет персистентными файлами и открывает их через дескрипторы на основе RAII для блочного чтения и записи.

Класс ara::per::FileStorage позволяет управлять и открывать набор сконфигурированных персистентных файлов по уникальным именам файлов [SWS_PER_00110]. Фактический доступ для чтения и записи осуществляется через аксессоры, управляемые по принципу UniqueHandle, которые автоматически закрывают файл при выходе из области видимости [SWS_PER_00114]. Поскольку уже открытые файлы защищены от конфликтующих операций удаления или восстановления, такие параллельные обращения завершаются с ошибкой PerErrc::kResourceBusy [SWS_PER_00111].

Контекст

Класс ara::per::FileStorage инкапсулирует доступ к сконфигурированной коллекции персистентных файлов, идентифицируемых по уникальным именам файлов. Он выступает в качестве центрального интерфейса для приложений при выполнении файловых операций, таких как получение списка существующих файлов через GetAllFileNames [SWS_PER_00110], проверка на существование с помощью FileExists [SWS_PER_00112], а также опрос метаданных и размеров файлов через GetFileInfo [SWS_PER_00438] и GetCurrentFileSize [SWS_PER_00407]. Прямой доступ на чтение или запись на уровне байтов при этом выполняется не на самом экземпляре хранилища, а через специальные объекты-аксессоры, предоставляемые методами открытия как UniqueHandle [SWS_PER_00114] [SWS_PER_00113] [SWS_PER_00115].

Жизненный цикл

Инстанцирование FileStorage подчиняется строгим ограничениям: конструктор по умолчанию [SWS_PER_00460], конструкторы копирования и перемещения [SWS_PER_00328] [SWS_PER_00326], а также операторы присваивания с копированием и перемещением [SWS_PER_00329] [SWS_PER_00327] явно удалены. Экземпляр FileStorage, следовательно, обычно открывается и предоставляется платформенными фабричными функциями модуля персистентности. Вопрос (открытый) Деструктор ~FileStorage является безопасным относительно исключений (noexcept), однако явно специфицирован как непотокобезопасный [SWS_PER_00330], поэтому должно быть обеспечено отсутствие параллельных вызовов объекта во время уничтожения.

В процессе работы обычные файловые операции, такие как FileExists, DeleteFile или открытие файлов, спроектированы как потокобезопасные [SWS_PER_00111] [SWS_PER_00112] [SWS_PER_00114]. Однако следует учитывать, что результаты запросов статуса, таких как GetAllFileNames [SWS_PER_00110] или FileExists [SWS_PER_00112], обладают точной достоверностью только тогда, когда в другом потоке одновременно не добавляются и не удаляются файлы. Аналогичное относится к GetFileInfo: время модификации и доступа, а также статус обработки являются надежно точными только до тех пор, пока целевой файл не открыт [SWS_PER_00438].

Путь использования

Типичный сценарий использования включает проверку, выборочное открытие, обработку данных через дескриптор аксессора и последующую очистку:

  1. Проверка статуса файла: перед доступом можно опционально выяснить через FileExists, существует ли требуемый файл [SWS_PER_00112], или запросить список файлов через GetAllFileNames [SWS_PER_00110].
  2. Открытие файла: в зависимости от предполагаемого режима доступа класс предоставляет специализированные методы. Для доступа только для чтения доступны перегрузки OpenFileReadOnly [SWS_PER_00114] [SWS_PER_00376] [SWS_PER_00430]. Для доступа на чтение и запись служит OpenFileReadWrite [SWS_PER_00113] [SWS_PER_00375] [SWS_PER_00429], при этом несуществующий файл создается автоматически. Для записи только служит OpenFileWriteOnly [SWS_PER_00115] [SWS_PER_00377] [SWS_PER_00431], который по умолчанию усекает файл (kTruncate) или создает его заново. Для повышения производительности при множестве мелких обращений перегрузки позволяют передавать пользовательский буфер для блочного чтения или записи [SWS_PER_00430] [SWS_PER_00429] [SWS_PER_00431].
  3. Закрытие файла и освобождение ресурсов: возвращаемый методами открытия ara::core::Result инкапсулирует UniqueHandle на соответствующий аксессор. Файл автоматически закрывается, как только этот UniqueHandle покидает свою область видимости [SWS_PER_00114] [SWS_PER_00113] [SWS_PER_00115]. Предположительно, при этом также снимается файловая отметка занятости в FileStorage. Вопрос (открытый)
  4. Обслуживание и очистка: больше не требующиеся файлы удаляются с помощью DeleteFile [SWS_PER_00111]. При нарушениях целостности RecoverFile обеспечивает восстановление избыточных данных по мере возможностей (Best-Effort) [SWS_PER_00337], тогда как ResetFile сбрасывает файл до его исходного содержимого развертывания или создает заново при его отсутствии [SWS_PER_00338].
Типичный сценарий использования FileStorageПриложениеstorage: FileStoragehandle: UniqueHandleUse Case: 1. Предварительная проверкаFileExists(fileName)Result<bool> (true)Use Case: 2. Открыть файлOpenFileReadOnly(fileName, mode, buffer)Result<UniqueHandle<ReadAccessor>>Use Case: 3. Dateiinhalt lesenБлочное чтение через AccessorGelesene Byte-DatenUse Case: 4. Закрытие при окончании области видимостиUniqueHandle покидает область видимостиДеструктор закрывает файлUse Case: 5. BereinigungDeleteFile(fileName)Result<void>

Диаграмма последовательности: типичный процесс от проверки и открытия файла через буферизованную обработку до автоматического закрытия по выходу дескриптора из области видимости. Источники: [SWS_PER_00112], [SWS_PER_00430], [SWS_PER_00114], [SWS_PER_00111].

Сценарии ошибок

Методы FileStorage сигнализируют об ошибках через ara::core::Result с использованием перечисления ошибок PerErrc. К наиболее важным ошибочным ситуациям относятся:

  • Конфликты ресурсов (PerErrc::kResourceBusy): файл не может быть открыт, удален, восстановлен или сброшен, если он уже открыт или параллельно выполняется DeleteFile, RecoverFile либо ResetFile для того же имени файла [SWS_PER_00111] [SWS_PER_00114] [SWS_PER_00113] [SWS_PER_00337] [SWS_PER_00338].
  • Файлы не найдены (PerErrc::kFileNotFound): возникает, если несуществующий файл пытаются открыть только для чтения [SWS_PER_00114], удалить [SWS_PER_00111], запросить [SWS_PER_00407] [SWS_PER_00438] или восстановить [SWS_PER_00337].
  • Нарушения доступа и полномочий: попытки открытия на запись или операции удаления завершаются с ошибкой PerErrc::kIllegalWriteAccess, если хранилище сконфигурировано только для чтения (read-only) [SWS_PER_00111] [SWS_PER_00113] [SWS_PER_00115]. Недопустимые комбинации режимов отклоняются с ошибкой PerErrc::kInvalidOpenMode [SWS_PER_00114] [SWS_PER_00113].
  • Ограничения памяти и квоты: при создании нового файла или увеличении размера могут возникать PerErrc::kOutOfStorageSpace (физическая память заполнена), PerErrc::kTooManyFiles (превышение maxNumberOfFiles) или PerErrc::kQuotaExceeded (превышение maximumAllowedSize) [SWS_PER_00113] [SWS_PER_00337] [SWS_PER_00338].
  • Ошибки целостности и безопасности: при сбоях физического уровня хранения сообщается PerErrc::kPhysicalStorageFailure. Поврежденные структуры данных, неудачные проверки валидности или криптографические проблемы приводят к PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed или PerErrc::kAuthenticationFailed [SWS_PER_00110] [SWS_PER_00112] [SWS_PER_00114] [SWS_PER_00337].
  • Отсутствие исходных данных (PerErrc::kInitValueNotAvailable): завершается ошибкой при сбросе через ResetFile, если начальные значения не были заданы ни в Application Design, ни в целевой конфигурации [SWS_PER_00338].

Настоящее руководство основано на спецификации AUTOSAR Adaptive Platform релиза R25-11 и обобщает функциональные требования к ara::per::FileStorage.

Карта членов

Диаграмма классов

Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.

G nara__per__FileStorage945 FileStorage + FileStorage() + operator=() + ~FileStorage() + DeleteFile() + FileExists() + GetAllFileNames() + GetCurrentFileSize() + GetFileInfo() + OpenFileReadOnly() + OpenFileReadWrite() + OpenFileWriteOnly() + RecoverFile() + ResetFile()

Подробный вид

Выберите элемент в оглавлении.

Конструкторы и деструктор

FileStorage функция 3

The move constructor for FileStorage shall not be used.

Перегрузки FileStorage 3
FileStorage (FileStorage &&fs)=delete; SWS_PER_00326
FileStorage (const FileStorage &)=delete; SWS_PER_00328
FileStorage ()=delete; SWS_PER_00460
~FileStorage функция

Destructor for FileStorage.

~FileStorage () noexcept;

Методы

DeleteFile функция

Deletes a file from this File Storage. This operation will fail with kResourceBusy when the file is currently open.

ara::core::Result< void > DeleteFile (ara::core::StringView fileName) noexcept;
FileExists функция

Checks if a file exists in this File Storage. The result is only accurate if no file is added or deleted at the same time. E.g. when a file is removed in another thread directly after this function returned "true", the result is not valid anymore.

ara::core::Result< bool > FileExists (ara::core::StringView fileName) const noexcept;
GetAllFileNames функция

Returns a list of all currently available file names of this File Storage. The list of file names is only accurate if no file is added or deleted at the same time.

ara::core::Result< ara::core::Vector< ara::core::String > > GetAllFile Names () const noexcept;
GetCurrentFileSize функция

Returns the space in bytes currently occupied by the content of a file of this File Storage. The returned size might be inaccurate if any of the instances of a file is invalid or if another operation on the file takes place at the same time.

ara::core::Result< std::uint64_t > GetCurrentFileSize (ara::core::StringView fileName) const noexcept;
GetFileInfo функция

Returns additional information on a file of this File Storage. The returned FileInfo struct contains information about the times when the file was created, last modified, and last accessed, and about how and by whom the file was created and last modified. The modificationTime, accessTime, and fileModificationState returned in the FileInfo are only accurate if the file is currently not open.

ara::core::Result< FileInfo > GetFileInfo (ara::core::StringView file Name) const noexcept;
OpenFileReadOnly функция 3

Opens a file of this File Storage for reading with a defined mode. If not otherwise specified by the provided mode, the file is opened with the seek position set to the beginning (corresponding to kAtTheBeginning). The file will be closed when the returned UniqueHandle goes out of scope.

Перегрузки OpenFileReadOnly 3
OpenFileReadWrite функция 3

Opens a file of this File Storage for reading and writing with a defined mode. If not otherwise specified by the provided mode, the file is opened with the seek position set to the beginning (corresponding to kAtTheBeginning). If the file does not exist, it is created. The file will be closed when the returned UniqueHandle goes out of scope.

Перегрузки OpenFileReadWrite 3
OpenFileWriteOnly функция 3

Opens a file of this File Storage for writing with a defined mode. If not otherwise specified by the provided mode, the file is truncated (corresponding to k Truncate). If the file does not exist, it is created. The file will be closed when the returned UniqueHandle goes out of scope.

Перегрузки OpenFileWriteOnly 3
RecoverFile функция

Recovers a file of this File Storage. This method allows to recover a single file when the redundancy checks fail. It will fail with kResourceBusy when the file is currently open. This method does a best-effort recovery of the file. After recovery, the file might show outdated or initial content, or might be lost.

ara::core::Result< void > RecoverFile (ara::core::StringView fileName) noexcept;
ResetFile функция

Resets a file of this File Storage to its initial content. ResetFile allows to reset a single file to its initial content. If the file is currently not available in the File Storage, it is re-created. Afterwards, the file will appear in both cases as if it was newly installed from the current Target Configuration. It will fail with kResourceBusy when the file is currently open, and with kInitValueNotAvailable when neither Application Design nor Target Configuration define an initial content for the file.

ara::core::Result< void > ResetFile (ara::core::StringView fileName) noexcept;

Операторы

operator= функция 2

The move assignment operator for FileStorage shall not be used.

Перегрузки = 2
FileStorage & operator= (FileStorage &&fs)=delete; SWS_PER_00327
FileStorage & operator= (const FileStorage &)=delete; SWS_PER_00329

Документация методов

функция DeleteFile [SWS_PER_00111] Upstream: RS_PER_00001, RS_PER_00004, RS_AP_00119, RS_AP_00120, RS_ AP_00121, RS_AP_00127, RS_AP_00128, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00159

ara::core::Result< void > DeleteFile (ara::core::StringView fileName) noexcept;

Deletes a file from this File Storage. This operation will fail with kResourceBusy when the file is currently open.

СОЗДАНО ИИ не проверено Модель: gemini-3.8-flash-medium · Усилие: medium · Температура: не регулируется · Промпт: 4416a2cc7c72 Происхождение
переведено с немецкого руководстваgemini-3.8-flash-low · 2026-10-13 · Немецкий оригинал

Синхронный метод DeleteFile класса ara::per::FileStorage удаляет файл по его имени (fileName) из файлового хранилища [SWS_PER_00111]. Идентификатор может соответствовать сконфигурированному PersistencyFile.fileName [SWS_PER_00111]. Вызов специфицирован как noexcept, считается безопасным к исключениям, а также потокобезопасным и сообщает о результате через ara::core::Result<void> [SWS_PER_00111].

Перед вызовом должны быть завершены все активные обращения к целевому файлу. Если файл в данный момент открыт, операция удаления завершается ошибкой PerErrc::kResourceBusy [SWS_PER_00111]. Поэтому приложения должны гарантировать, что экземпляры UniqueHandle, созданные ранее через OpenFileReadWrite [SWS_PER_00113], OpenFileReadOnly [SWS_PER_00114] или OpenFileWriteOnly [SWS_PER_00115], вышли из своей области видимости, в результате чего файл закрывается. Аналогично параллельное выполнение RecoverFile [SWS_PER_00337] или ResetFile [SWS_PER_00338] для того же имени файла приводит к PerErrc::kResourceBusy [SWS_PER_00111].

В случае сбоя возвращаемый тип Result предоставляет конкретные причины ошибок [SWS_PER_00111]:

  • PerErrc::kFileNotFound: указанный файл не существует в файловом хранилище [SWS_PER_00111].
  • PerErrc::kIllegalWriteAccess: хранилище File Storage настроено только для чтения [SWS_PER_00111].
  • PerErrc::kPhysicalStorageFailure: доступ к физическому носителю данных завершается сбоем (без семантики отката) [SWS_PER_00111].
  • PerErrc::kIntegrityCorrupted, PerErrc::kEncryptionFailed или PerErrc::kAuthenticationFailed: ошибки структурной целостности, шифрования/дешифрования или проверки MAC (каждая с семантикой отката), а также ошибки, специфичные для производителя [SWS_PER_00111].

Этот текст был сгенерирован ИИ и служит в качестве ориентира. Обязательную силу имеют исключительно спецификации документации AUTOSAR.

Руководство разработчика реализации в подготовке (сложность I2)

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
fileNameFile name of the file. May correspond to the PersistencyFile.file Name of a configured file.

Rückgabewert

TypBeschreibung
ara::core::Result< void >A Result of void. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
PerErrc::kIllegalWriteAccessrollback_semantics Returned if the File Storage is configured as read-only.
PerErrc::kPhysicalStorageFailureno_rollback_semantics Returned if access to the physical storage fails.
PerErrc::kIntegrityCorruptedrollback_semantics Returned if stored data cannot be written because the structural integrity is corrupted.
PerErrc::kEncryptionFailedrollback_semantics Returned if the encryption or decryption of stored data fails.
PerErrc::kResourceBusyrollback_semantics Returned if the file is open, or if RecoverFile or ResetFile with the same file name is currently being executed.
PerErrc::kFileNotFoundrollback_semantics Returned if the provided file does not exist in the File Storage.
PerErrc::kAuthenticationFailedrollback_semantics Returned if calculating or checking the MAC of stored data fails.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00111
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00111@rel:R25-11#f546c033
Content hash
f546c033
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00111
Status: valid/unmigrated Version: rel:R25-11#54be3f24 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00111@rel:R25-11#54be3f24
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#9014bbf32026-09-30
  • R19-11rel:R19-11#878a9ae32026-10-14
  • R20-11rel:R20-11#c8f140db2026-10-14
  • R21-11rel:R21-11#35984aa22026-10-14
  • R22-11rel:R22-11#86df5bb02026-10-14
  • R23-11rel:R23-11#a507e2692026-10-14
  • R24-11rel:R24-11#5c96fd1e2026-10-14
  • R25-11rel:R25-11#54be3f242026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция FileExists [SWS_PER_00112] Upstream: RS_PER_00001, RS_PER_00004, RS_AP_00119, RS_AP_00120, RS_ AP_00121, RS_AP_00127, RS_AP_00135, RS_AP_00139, RS_AP_00159

ara::core::Result< bool > FileExists (ara::core::StringView fileName) const noexcept;

Checks if a file exists in this File Storage. The result is only accurate if no file is added or deleted at the same time. E.g. when a file is removed in another thread directly after this function returned "true", the result is not valid anymore.

СОЗДАНО ИИ не проверено Модель: gemini-3.8-flash-medium · Усилие: medium · Температура: не регулируется · Промпт: f0bea0a79212 Происхождение
переведено с немецкого руководстваgemini-3.8-flash-low · 2026-10-13 · Немецкий оригинал

Синхронный метод FileExists класса ara::per::FileStorage проверяет, присутствует ли файл в соответствующем файловом хранилище [SWS_PER_00112]. Функция объявлена как noexcept и не генерирует исключений C++ [SWS_PER_00112].

Использование

В качестве параметра передается fileName в виде ara::core::StringView, что может соответствовать идентификатору PersistencyFile.fileName сконфигурированного файла [SWS_PER_00112]. Возвращаемое значение ara::core::Result<bool> возвращает true, если файл удалось найти, и false в противном случае [SWS_PER_00112].

Обработка ошибок

Если проверка завершается неудачно, возвращаемое Result содержит не логическое значение, а код ошибки [SWS_PER_00112]. Специфицированными причинами ошибок являются:

  • PerErrc::kPhysicalStorageFailure при сбое физического доступа к хранилищу [SWS_PER_00112],
  • PerErrc::kIntegrityCorrupted при повреждении структурной целостности данных [SWS_PER_00112],
  • PerErrc::kValidationFailed, если невозможно гарантировать валидность сохраненных данных [SWS_PER_00112],
  • PerErrc::kEncryptionFailed при неудачной расшифровке [SWS_PER_00112],
  • PerErrc::kAuthenticationFailed при сбое проверки MAC [SWS_PER_00112], а также возможные специфические для поставщика ошибки [SWS_PER_00112].

Параллелизм и ограничения

Метод объявлен как потокобезопасный [SWS_PER_00112]. Однако полученный результат проверки является точным лишь постольку, поскольку одновременно в хранилище не добавляются и не удаляются файлы; если, например, другой поток удалит файл сразу после возврата true, результат уже недействителен [SWS_PER_00112].

Данное указание по использованию сгенерировано автоматически на основе AUTOSAR R25-11.

Руководство разработчика реализации в подготовке (сложность I1)

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe PerErrc::kPhysical rollback_semantics

Parameter (in)

ParameterBeschreibung
fileNameFile name of the file. May correspond to the PersistencyFile.file Name of a configured file.

Rückgabewert

TypBeschreibung
ara::core::Result< bool >A Result containing true if the file could be located or false if it couldn’t. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
StorageFailureReturned if access to the physical storage fails.
PerErrc::kIntegrityCorruptedrollback_semantics Returned if stored data cannot be read because the structural integrity is corrupted.
PerErrc::kValidationFailedrollback_semantics Returned if the validity of stored data cannot be ensured.
PerErrc::kEncryptionFailedrollback_semantics Returned if the decryption of stored data fails.
PerErrc::kAuthenticationFailedrollback_semantics Returned if checking the MAC of stored data fails.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00112
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00112@rel:R25-11#8e08b259
Content hash
8e08b259
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00112
Status: valid/unmigrated Version: rel:R25-11#eff770fd Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00112@rel:R25-11#eff770fd
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#b7ca36222026-09-30
  • R19-11rel:R19-11#bb51dd332026-10-14
  • R20-11rel:R20-11#69021fcb2026-10-14
  • R21-11rel:R21-11#a1fece9f2026-10-14
  • R22-11rel:R22-11#2147fabd2026-10-14
  • R23-11rel:R23-11#cd2da2ba2026-10-14
  • R24-11rel:R24-11#421ba73d2026-10-14
  • R25-11rel:R25-11#eff770fd2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция FileStorage [SWS_PER_00326] Upstream: RS_PER_00004, RS_AP_00120, RS_AP_00121, RS_AP_00129, RS_AP_00145, RS_AP_00159

FileStorage (FileStorage &&fs)=delete;

The move constructor for FileStorage shall not be used.

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00326
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00326@rel:R25-11#097d3b26
Content hash
097d3b26
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00326
Status: valid/unmigrated Version: rel:R25-11#62da63ae Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00326@rel:R25-11#62da63ae
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#201fb7f12026-09-30
  • R19-11rel:R19-11#ee041ade2026-10-14
  • R20-11rel:R20-11#b225c72d2026-10-14
  • R21-11rel:R21-11#805cfb8b2026-10-14
  • R22-11rel:R22-11#a9c3021b2026-10-14
  • R23-11rel:R23-11#4fc6a3d12026-10-14
  • R24-11rel:R24-11#62da63ae2026-10-14
  • R25-11rel:R25-11#62da63ae2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция FileStorage [SWS_PER_00328] Upstream: RS_PER_00004, RS_AP_00120, RS_AP_00145

FileStorage (const FileStorage &)=delete;

The copy constructor for FileStorage shall not be used.

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00328
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00328@rel:R25-11#6c68556e
Content hash
6c68556e
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00328
Status: valid/unmigrated Version: rel:R25-11#457a8c69 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00328@rel:R25-11#457a8c69
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#210f83712026-09-30
  • R19-11rel:R19-11#b53f0afb2026-10-14
  • R20-11rel:R20-11#4fbd234e2026-10-14
  • R21-11rel:R21-11#4fbd234e2026-10-14
  • R22-11rel:R22-11#3d9e304b2026-10-14
  • R23-11rel:R23-11#9edf14a62026-10-14
  • R24-11rel:R24-11#4f3e23582026-10-14
  • R25-11rel:R25-11#457a8c692026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция FileStorage [SWS_PER_00460] Upstream: RS_PER_00004, RS_AP_00120, RS_AP_00129, RS_AP_00146

FileStorage ()=delete;

The default constructor for FileStorage shall not be used.

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00460
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00460@rel:R25-11#5256be11
Content hash
5256be11
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00460
Status: valid/unmigrated Version: rel:R25-11#11aa6301 Versionshistorie & Revisions (1 transition, 6 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00460@rel:R25-11#11aa6301
Point-in-Time History:
Recorded Revisions (6):
  • R25-11rel:R25-11#9eb415912026-09-30
  • R21-11rel:R21-11#f93f78842026-10-14
  • R22-11rel:R22-11#1e2c76302026-10-14
  • R23-11rel:R23-11#dd525b8f2026-10-14
  • R24-11rel:R24-11#11aa63012026-10-14
  • R25-11rel:R25-11#11aa63012026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция GetAllFileNames [SWS_PER_00110] Upstream: RS_PER_00001, RS_PER_00004, RS_AP_00119, RS_AP_00120, RS_ AP_00127, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00159

ara::core::Result< ara::core::Vector< ara::core::String > > GetAllFile Names () const noexcept;

Returns a list of all currently available file names of this File Storage. The list of file names is only accurate if no file is added or deleted at the same time.

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe PerErrc::kPhysical rollback_semantics

Rückgabewert

TypBeschreibung
ara::core::Result<ara::core::Vector<ara::core::String > >A Result containing a list of available file names. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
StorageFailureReturned if access to the physical storage fails.
PerErrc::kIntegrityCorruptedrollback_semantics Returned if stored data cannot be read because the structural integrity is corrupted.
PerErrc::kValidationFailedrollback_semantics Returned if the validity of stored data cannot be ensured.
PerErrc::kEncryptionFailedrollback_semantics Returned if the decryption of stored data fails.
PerErrc::kAuthenticationFailedrollback_semantics Returned if checking the MAC of stored data fails.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00110
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00110@rel:R25-11#9a22f695
Content hash
9a22f695
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00110
Status: valid/unmigrated Version: rel:R25-11#2a355aef Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00110@rel:R25-11#2a355aef
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#2ea4c0b72026-09-30
  • R19-11rel:R19-11#2c8803ba2026-10-14
  • R20-11rel:R20-11#6c4ecd642026-10-14
  • R21-11rel:R21-11#7a8244992026-10-14
  • R22-11rel:R22-11#1e3bc0af2026-10-14
  • R23-11rel:R23-11#0cb5785b2026-10-14
  • R24-11rel:R24-11#2a355aef2026-10-14
  • R25-11rel:R25-11#2a355aef2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция GetCurrentFileSize [SWS_PER_00407] Upstream: RS_PER_00017, RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00127, RS_AP_00128, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00159

ara::core::Result< std::uint64_t > GetCurrentFileSize (ara::core::StringView fileName) const noexcept;

Returns the space in bytes currently occupied by the content of a file of this File Storage. The returned size might be inaccurate if any of the instances of a file is invalid or if another operation on the file takes place at the same time.

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
fileNameFile name of the file. May correspond to the PersistencyFile.file Name of a configured file.

Rückgabewert

TypBeschreibung
ara::core::Result<std::uint64_t >A Result containing the occupied space in bytes. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
PerErrc::kPhysicalStorageFailurerollback_semantics Returned if access to the physical storage fails.
PerErrc::kIntegrityCorruptedrollback_semantics Returned if stored data cannot be read because the structural integrity is corrupted.
PerErrc::kEncryptionFailedrollback_semantics Returned if the decryption of stored data fails.
PerErrc::kFileNotFoundrollback_semantics Returned if the provided file does not exist in the File Storage.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00407
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00407@rel:R25-11#e68d85c3
Content hash
e68d85c3
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00407
Status: valid/unmigrated Version: rel:R25-11#179f149b Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00407@rel:R25-11#179f149b
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#071859e92026-09-30
  • R19-11rel:R19-11#033eba912026-10-14
  • R20-11rel:R20-11#3966ef4c2026-10-14
  • R21-11rel:R21-11#d10d2b0b2026-10-14
  • R22-11rel:R22-11#8dd5feab2026-10-14
  • R23-11rel:R23-11#9f29c68f2026-10-14
  • R24-11rel:R24-11#179f149b2026-10-14
  • R25-11rel:R25-11#179f149b2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция GetFileInfo [SWS_PER_00438] Upstream: RS_PER_00004, RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00127, RS_AP_00128, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00159

ara::core::Result< FileInfo > GetFileInfo (ara::core::StringView file Name) const noexcept;

Returns additional information on a file of this File Storage. The returned FileInfo struct contains information about the times when the file was created, last modified, and last accessed, and about how and by whom the file was created and last modified. The modificationTime, accessTime, and fileModificationState returned in the FileInfo are only accurate if the file is currently not open.

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
fileNameFile name of the file. May correspond to the PersistencyFile.file Name of a configured file.

Rückgabewert

TypBeschreibung
ara::core::Result< FileInfo >A Result containing a FileInfo struct. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
PerErrc::kPhysicalStorageFailurerollback_semantics Returned if access to the physical storage fails.
PerErrc::kIntegrityCorruptedrollback_semantics Returned if stored data cannot be read because the structural integrity is corrupted.
PerErrc::kEncryptionFailedrollback_semantics Returned if the decryption of stored data fails.
PerErrc::kFileNotFoundrollback_semantics Returned if the provided file does not exist in the File Storage.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00438
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00438@rel:R25-11#f44a2b8a
Content hash
f44a2b8a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00438
Status: valid/unmigrated Version: rel:R25-11#ac6ae9db Versionshistorie & Revisions (1 transition, 7 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00438@rel:R25-11#ac6ae9db
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#54615ca12026-09-30
  • R20-11rel:R20-11#3e42a8462026-10-14
  • R21-11rel:R21-11#2ca508bf2026-10-14
  • R22-11rel:R22-11#374465322026-10-14
  • R23-11rel:R23-11#57dca30b2026-10-14
  • R24-11rel:R24-11#87296ea62026-10-14
  • R25-11rel:R25-11#ac6ae9db2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция OpenFileReadOnly [SWS_PER_00114] Upstream: RS_PER_00001, RS_PER_00004, RS_PER_00010, RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00127, RS_AP_00128, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00144, RS_AP_00159

ara::core::Result< UniqueHandle< ReadAccessor > > OpenFileReadOnly (ara::core::StringView fileName, OpenMode mode) noexcept;

Opens a file of this File Storage for reading with a defined mode. If not otherwise specified by the provided mode, the file is opened with the seek position set to the beginning (corresponding to kAtTheBeginning). The file will be closed when the returned UniqueHandle goes out of scope.

СОЗДАНО ИИ не проверено Модель: gemini-3.8-flash-medium · Усилие: medium · Температура: не регулируется · Промпт: b7f6df93c4d9 Происхождение
переведено с немецкого руководстваgemini-3.8-flash-low · 2026-10-13 · Немецкий оригинал

Метод OpenFileReadOnly класса ara::per::FileStorage (объявленный в #include "ara/per/file_storage.h") открывает сохранённый файл только для чтения с заданным режимом доступа [SWS_PER_00114]. Если параметром mode не указано иное, позиция указателя чтения по умолчанию устанавливается на начало файла (kAtTheBeginning) [SWS_PER_00114]. Выполнение происходит синхронно и возвращает ara::core::Result<UniqueHandle<ReadAccessor>>. Дескриптор использует семантику RAII: как только экземпляр UniqueHandle выходит из области видимости, файл закрывается автоматически [SWS_PER_00114].

В отношении параллелизма метод специфицирован как thread-safe и exception safe (с noexcept) [SWS_PER_00114]. Тем не менее существуют функциональные ограничения вызова: если целевой файл уже открыт или одновременно выполняются операции, такие как DeleteFile, RecoverFile или ResetFile с тем же именем файла, вызов завершается с ошибкой PerErrc::kResourceBusy [SWS_PER_00114].

В случае ошибки ara::core::Result возвращает специфичные для производителя ошибки или стандартизированные коды ошибок из PerErrc либо StorageFailure [SWS_PER_00114]:

  • PerErrc::kFileNotFound: указанный файл не существует в файловом хранилище [SWS_PER_00114].
  • PerErrc::kInvalidOpenMode: переданный режим содержит недопустимую комбинацию флагов [SWS_PER_00114].
  • StorageFailure: доступ к физическому накопителю завершился сбоем [SWS_PER_00114].
  • PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kAuthenticationFailed или PerErrc::kEncryptionFailed: структурная целостность повреждена, валидация недостаточна, проверка MAC ошибочна или дешифрование не удалось [SWS_PER_00114].

Во взаимодействии с другими интерфейсами FileStorage предлагает две родственные перегрузки: вариант без параметра режима, который всегда открывает в начале файла [SWS_PER_00376], а также перегрузку с буфером (ara::core::Span<ara::core::Byte> buffer), через который ReadAccessor реализует блочное чтение для ускорения множества мелких операций доступа [SWS_PER_00430].

Данное указание по использованию было автоматически сгенерировано на основе спецификации AUTOSAR Adaptive R25-11.

Руководство разработчика реализации в подготовке (сложность I1)

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe PerErrc::kPhysical rollback_semantics

Parameter (in)

ParameterBeschreibung
fileNameFile name of the file. May correspond to the PersistencyFile.file Name of a configured file.
modeMode with which the file shall be opened.

Rückgabewert

TypBeschreibung
ara::core::Result<UniqueHandle< ReadAccessor > >A Result containing a UniqueHandle for the file. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
StorageFailureReturned if access to the physical storage fails.
PerErrc::kIntegrityCorruptedrollback_semantics Returned if stored data cannot be read because the structural integrity is corrupted.
PerErrc::kValidationFailedrollback_semantics Returned if the validity of stored data cannot be ensured.
PerErrc::kEncryptionFailedrollback_semantics Returned if the decryption of stored data fails.
PerErrc::kResourceBusyrollback_semantics Returned if the file is already open, or if DeleteFile, RecoverFile, or ResetFile with the same file name is currently being executed.
PerErrc::kFileNotFoundrollback_semantics Returned if the provided file does not exist in the File Storage.
PerErrc::kInvalidOpenModerollback_semantics Returned if the passed mode contains an invalid combination of modes.
PerErrc::kAuthenticationFailedrollback_semantics Returned if checking the MAC of stored data fails.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00114
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00114@rel:R25-11#64488222
Content hash
64488222
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00114
Status: valid/unmigrated Version: rel:R25-11#d387e566 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00114@rel:R25-11#d387e566
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#56472e6d2026-09-30
  • R19-11rel:R19-11#68c3cec42026-10-14
  • R20-11rel:R20-11#70976e3f2026-10-14
  • R21-11rel:R21-11#2c5ff8412026-10-14
  • R22-11rel:R22-11#2b3b319d2026-10-14
  • R23-11rel:R23-11#e52382f02026-10-14
  • R24-11rel:R24-11#f80914872026-10-14
  • R25-11rel:R25-11#d387e5662026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция OpenFileReadOnly [SWS_PER_00376] Upstream: RS_PER_00001, RS_PER_00004, RS_PER_00010, RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00127, RS_AP_00128, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00144, RS_AP_00159

ara::core::Result< UniqueHandle< ReadAccessor > > OpenFileReadOnly (ara::core::StringView fileName) noexcept;

Opens a file of this File Storage for reading. The file is opened with the seek position set to the beginning (corresponding to kAtThe Beginning). The file will be closed when the returned UniqueHandle goes out of scope.

СОЗДАНО ИИ не проверено Модель: gemini-3.8-flash-medium · Усилие: medium · Температура: не регулируется · Промпт: 4286b0e81322 Происхождение
переведено с немецкого руководстваgemini-3.8-flash-low · 2026-10-13 · Немецкий оригинал

Использование

Метод OpenFileReadOnly класса ara::per::FileStorage открывает персистентный файл только для чтения [SWS_PER_00376]. Вызов выполняется через заголовочный файл ara/per/file_storage.h с передачей имени файла fileName. При этом позиция чтения изначально устанавливается в начало файла. В качестве возвращаемого значения служит ara::core::Result, предоставляющий UniqueHandle<ReadAccessor> при успешном завершении. Открытый файл автоматически закрывается, как только данный дескриптор выходит из своей области видимости.

Обработка ошибок

В случае сбоя выполнения результат содержит код ошибки или ошибку, специфичную для производителя [SWS_PER_00376]:

  • PerErrc::kFileNotFound: указанный файл отсутствует в хранилище.
  • PerErrc::kResourceBusy: файл уже открыт или одновременно обрабатывается с помощью DeleteFile, RecoverFile либо ResetFile.
  • PerErrc::kPhysicalStorageFailure: произошел сбой доступа к физическому носителю данных.
  • PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed, PerErrc::kAuthenticationFailed: ошибки структурной целостности, валидации данных, дешифрования или проверки MAC.

Параллелизм и взаимодействие

Метод специфицирован как thread-safe, exception safe, а также noexcept [SWS_PER_00376]. Для расширенных требований предусмотрены перегрузки: вариант для явного указания OpenMode [SWS_PER_00114], а также сигнатура с дополнительным пользовательским буфером для блочного ускорения небольших операций чтения [SWS_PER_00430].

Это указание по использованию было создано автоматически на основе спецификации AUTOSAR.

Руководство разработчика реализации в подготовке (сложность I1)

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe PerErrc::kPhysical rollback_semantics

Parameter (in)

ParameterBeschreibung
fileNameFile name of the file. May correspond to the PersistencyFile.file Name of a configured file.

Rückgabewert

TypBeschreibung
ara::core::Result<UniqueHandle< ReadAccessor > >A Result containing a UniqueHandle for the file. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
StorageFailureReturned if access to the physical storage fails.
PerErrc::kIntegrityCorruptedrollback_semantics Returned if stored data cannot be read because the structural integrity is corrupted.
PerErrc::kValidationFailedrollback_semantics Returned if the validity of stored data cannot be ensured.
PerErrc::kEncryptionFailedrollback_semantics Returned if the decryption of stored data fails.
PerErrc::kResourceBusyrollback_semantics Returned if the file is already open, or if DeleteFile, RecoverFile, or ResetFile with the same file name is currently being executed.
PerErrc::kFileNotFoundrollback_semantics Returned if the provided file does not exist in the File Storage.
PerErrc::kAuthenticationFailedrollback_semantics Returned if checking the MAC of stored data fails.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00376
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00376@rel:R25-11#29d4c899
Content hash
29d4c899
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00376
Status: valid/unmigrated Version: rel:R25-11#c1cc1c73 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00376@rel:R25-11#c1cc1c73
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#f25323df2026-09-30
  • R19-11rel:R19-11#630d35ad2026-10-14
  • R20-11rel:R20-11#c212e2fc2026-10-14
  • R21-11rel:R21-11#d617d2d22026-10-14
  • R22-11rel:R22-11#88f516892026-10-14
  • R23-11rel:R23-11#eab160e12026-10-14
  • R24-11rel:R24-11#6b07bd902026-10-14
  • R25-11rel:R25-11#c1cc1c732026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция OpenFileReadOnly [SWS_PER_00430] Upstream: RS_PER_00001, RS_PER_00004, RS_PER_00010, RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00127, RS_AP_00128, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00144, RS_AP_00159

ara::core::Result< UniqueHandle< ReadAccessor > > OpenFileReadOnly (ara::core::StringView fileName, OpenMode mode, ara::core::Span< ara::core::Byte > buffer) noexcept;

Opens a file of this File Storage for reading with a user provided buffer. If not otherwise specified by the provided mode, the file is opened with the seek position set to the beginning (corresponding to kAtTheBeginning). The provided buffer will be used by the ReadAccessor to implement block-wise reading to speed up multiple small accesses to the file. The file will be closed when the returned UniqueHandle goes out of scope.

СОЗДАНО ИИ не проверено Модель: gemini-3.8-flash-medium · Усилие: medium · Температура: не регулируется · Промпт: f3a0884b9d84 Происхождение
переведено с немецкого руководстваgemini-3.8-flash-low · 2026-10-13 · Немецкий оригинал

Синхронный метод OpenFileReadOnly класса ara::per::FileStorage открывает персистентный файл для доступа на чтение с использованием буфера, предоставленного вызывающей стороной [SWS_PER_00430]. Доступ к файлу инициализируется на основе параметров fileName, mode, а также buffer (в виде ara::core::Span<ara::core::Byte>) [SWS_PER_00430]. Если через mode не задано иное, позиция чтения по умолчанию находится в начале файла (kAtTheBeginning) [SWS_PER_00430]. Переданная область памяти используется результирующим ReadAccessor для ускорения повторяющихся мелких операций чтения за счет блочного считывания [SWS_PER_00430]. Ресурс защищен с помощью RAII: как только возвращенный UniqueHandle выходит из области видимости, файл автоматически закрывается [SWS_PER_00430].

С точки зрения параллелизма функция специфицирована как потокобезопасная (thread-safe), исключебно-безопасная (exception safe) и noexcept [SWS_PER_00430]. При возникновении ошибки ara::core::Result возвращает ошибки, специфичные для производителя, или стандартизированные коды ошибок из PerErrc [SWS_PER_00430]:

  • PerErrc::kResourceBusy: файл уже открыт или одновременно обрабатывается с помощью DeleteFile, RecoverFile либо ResetFile [SWS_PER_00430].
  • PerErrc::kFileNotFound: указанный файл не существует в файловом хранилище [SWS_PER_00430].
  • PerErrc::kInvalidOpenMode: переданный режим содержит недопустимую комбинацию опций [SWS_PER_00430].
  • Ошибки целостности и безопасности: PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed или PerErrc::kAuthenticationFailed (сбой проверки MAC), а также StorageFailure при ошибках физического доступа к носителю [SWS_PER_00430].

Наряду с этим буферизованным вариантом для сценариев применения без пользовательского буфера доступны перегрузки [SWS_PER_00114] (с mode) и [SWS_PER_00376] (только с fileName).

Это указание по использованию было автоматически сгенерировано на основе спецификации AUTOSAR R25-11.

Руководство разработчика реализации в подготовке (сложность I1)

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe PerErrc::kPhysical rollback_semantics

Parameter (in)

ParameterBeschreibung
fileNameFile name of the file. May correspond to the PersistencyFile.file Name of a configured file.
modeMode with which the file shall be opened.
bufferMemory to be used for block-wise reading.

Rückgabewert

TypBeschreibung
ara::core::Result<UniqueHandle< ReadAccessor > >A Result containing a UniqueHandle for the file. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
StorageFailureReturned if access to the physical storage fails.
PerErrc::kIntegrityCorruptedrollback_semantics Returned if stored data cannot be read because the structural integrity is corrupted.
PerErrc::kValidationFailedrollback_semantics Returned if the validity of stored data cannot be ensured.
PerErrc::kEncryptionFailedrollback_semantics Returned if the decryption of stored data fails.
PerErrc::kResourceBusyrollback_semantics Returned if the file is already open, or if DeleteFile, RecoverFile, or ResetFile with the same file name is currently being executed.
PerErrc::kFileNotFoundrollback_semantics Returned if the provided file does not exist in the File Storage.
PerErrc::kInvalidOpenModerollback_semantics Returned if the passed mode contains an invalid combination of modes.
PerErrc::kAuthenticationFailedrollback_semantics Returned if checking the MAC of stored data fails.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00430
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00430@rel:R25-11#41e8dd4d
Content hash
41e8dd4d
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00430
Status: valid/unmigrated Version: rel:R25-11#6f001bfd Versionshistorie & Revisions (1 transition, 7 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00430@rel:R25-11#6f001bfd
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#d5ddc0d92026-09-30
  • R20-11rel:R20-11#a9e488522026-10-14
  • R21-11rel:R21-11#f7bf78f42026-10-14
  • R22-11rel:R22-11#668067d82026-10-14
  • R23-11rel:R23-11#bc8680862026-10-14
  • R24-11rel:R24-11#062cbdd82026-10-14
  • R25-11rel:R25-11#6f001bfd2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция OpenFileReadWrite [SWS_PER_00113] Upstream: RS_PER_00001, RS_PER_00004, RS_PER_00010, RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00127, RS_AP_00128, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00144, RS_AP_00159

ara::core::Result< UniqueHandle< ReadWriteAccessor > > OpenFileRead Write (ara::core::StringView fileName, OpenMode mode) noexcept;

Opens a file of this File Storage for reading and writing with a defined mode. If not otherwise specified by the provided mode, the file is opened with the seek position set to the beginning (corresponding to kAtTheBeginning). If the file does not exist, it is created. The file will be closed when the returned UniqueHandle goes out of scope.

СОЗДАНО ИИ не проверено Модель: gemini-3.8-flash-medium · Усилие: medium · Температура: не регулируется · Промпт: cf05039b8020 Происхождение
переведено с немецкого руководстваgemini-3.8-flash-low · 2026-10-13 · Немецкий оригинал

Использование

Синхронный метод OpenFileReadWrite класса ara::per::FileStorage открывает файл для доступа на чтение и запись в указанном режиме mode [SWS_PER_00113]. Если в режиме не указано иное, файловый указатель по умолчанию устанавливается в начало (kAtTheBeginning). Если файл ещё не существует, он создаётся автоматически [SWS_PER_00113]. Функция возвращает ara::core::Result с UniqueHandle<ReadWriteAccessor>, который автоматически закрывает файл, как только дескриптор покидает свою область видимости [SWS_PER_00113].

Параллелизм и ограничения

Вызов является потокобезопасным (thread-safe) и не генерирует исключений (noexcept) [SWS_PER_00113]. Файл не должен быть уже открыт при вызове. Кроме того, не должно происходить одновременного выполнения DeleteFile, RecoverFile или ResetFile с тем же именем файла, так как иначе вызов завершится ошибкой с PerErrc::kResourceBusy [SWS_PER_00113].

Обработка ошибок

В случае ошибки ara::core::Result содержит специфические коды ошибок [SWS_PER_00113]:

  • PerErrc::kInvalidOpenMode: недопустимая комбинация флагов в переданном mode.
  • PerErrc::kResourceBusy: целевой файл уже открыт или занят административными файловыми операциями.
  • Access: хранилище сконфигурировано как read-only или как write-only-once при уже существующем ключе.
  • PerErrc::kOutOfStorageSpace или PerErrc::kTooManyFiles: нехватка физического места в хранилище или превышение maxNumberOfFiles при повторном создании.
  • PerErrc::kPhysicalStorageFailure, PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed, PerErrc::kAuthenticationFailed: ошибки доступа к оборудованию, повреждённые структуры данных или неудачные криптографические проверки подлинности.

Взаимодействие

В качестве упрощённого варианта доступна перегрузка без параметра режима, которая по умолчанию открывает файлы в начале [SWS_PER_00375]. Для оптимизации производительности при многочисленных мелких обращениях дополнительно существует перегрузка с пользовательским буфером (buffer) для блочного чтения и записи [SWS_PER_00429].

Данное указание по использованию было сгенерировано ИИ на основе спецификации AUTOSAR Adaptive релиза R25-11.

Руководство разработчика реализации в подготовке (сложность I1)

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe PerErrc::kIllegalWrite rollback_semantics

Parameter (in)

ParameterBeschreibung
fileNameFile name of the file. May correspond to the PersistencyFile.file Name of a configured file.
modeMode with which the file shall be opened.

Rückgabewert

TypBeschreibung
ara::core::Result<UniqueHandle< ReadWriteAccessor > >A Result containing a UniqueHandle for the file. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
AccessReturned if the File Storage is configured as read-only, or if it is configured as write-only-once and the key already exists.
PerErrc::kPhysicalStorageFailureno_rollback_semantics Returned if access to the physical storage fails.
PerErrc::kIntegrityCorruptedrollback_semantics Returned if stored data cannot be read because the structural integrity is corrupted.
PerErrc::kValidationFailedrollback_semantics Returned if the validity of stored data cannot be ensured.
PerErrc::kEncryptionFailedrollback_semantics Returned if the decryption of stored data fails.
PerErrc::kResourceBusyrollback_semantics Returned if the file is already open, or if DeleteFile, RecoverFile, or ResetFile with the same file name is currently being executed.
PerErrc::kOutOfStorageSpaceno_rollback_semantics Returned if the available physical storage space is insufficient for a new file.
PerErrc::kInvalidOpenModerollback_semantics Returned if the passed mode contains an invalid combination of modes.
PerErrc::kTooManyFilesrollback_semantics Returned if the number of files would get larger than the configured maxNumberOfFiles when the file is created.
PerErrc::kAuthenticationFailedrollback_semantics Returned if checking the MAC of stored data fails.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00113
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00113@rel:R25-11#228e1bef
Content hash
228e1bef
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00113
Status: valid/unmigrated Version: rel:R25-11#64fa2a80 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00113@rel:R25-11#64fa2a80
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#b7812ac62026-09-30
  • R19-11rel:R19-11#29f193992026-10-14
  • R20-11rel:R20-11#705aebbc2026-10-14
  • R21-11rel:R21-11#3e1bef852026-10-14
  • R22-11rel:R22-11#8b90a8c62026-10-14
  • R23-11rel:R23-11#9d0c90192026-10-14
  • R24-11rel:R24-11#c88f05782026-10-14
  • R25-11rel:R25-11#64fa2a802026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция OpenFileReadWrite [SWS_PER_00375] Upstream: RS_PER_00001, RS_PER_00004, RS_PER_00010, RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00127, RS_AP_00128, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00144, RS_AP_00159

ara::core::Result< UniqueHandle< ReadWriteAccessor > > OpenFileRead Write (ara::core::StringView fileName) noexcept;

Opens a file of this File Storage for reading and writing. The file is opened with the seek position set to the beginning (corresponding to kAtThe Beginning). If the file does not exist, it is created. The file will be closed when the returned UniqueHandle goes out of scope.

СОЗДАНО ИИ не проверено Модель: gemini-3.8-flash-medium · Усилие: medium · Температура: не регулируется · Промпт: e0c7dc90877b Происхождение
переведено с немецкого руководстваgemini-3.8-flash-low · 2026-10-13 · Немецкий оригинал

Синхронная функция-член OpenFileReadWrite класса ara::per::FileStorage служит для открытия файла для комбинированного доступа на чтение и запись [SWS_PER_00375]. В качестве параметра передается имя файла fileName как ara::core::StringView, которое может соответствовать моделированию PersistencyFile.fileName сконфигурированного файла [SWS_PER_00375]. Если указанный файл еще не существует, он создается автоматически [SWS_PER_00375]. При открытии позиция в файле сразу устанавливается в начало (соответственно kAtTheBeginning) [SWS_PER_00375]. Вызывающая сторона получает ara::core::Result<UniqueHandle<ReadWriteAccessor>>; файл автоматически закрывается, как только возвращенный UniqueHandle выходит из своей области видимости [SWS_PER_00375].

С точки зрения параллелизма и контекста выполнения функция специфицирована как thread-safe и exception safe [SWS_PER_00375]. Однако следует учитывать, что одновременный доступ регламентирован: если файл уже открыт или одновременно выполняется такая операция, как DeleteFile, RecoverFile или ResetFile над тем же именем файла, вызов завершается сбоем и возвращает код ошибки PerErrc::kResourceBusy [SWS_PER_00375].

В случае ошибки возвращенный объект Result инкапсулирует специфические ошибки персистентности или специфические для производителя ошибки [SWS_PER_00375]:

  • Ошибки конфигурации и доступа, такие как Access при памяти, защищенной от записи, или уже существующих данных при конфигурации Write-Once [SWS_PER_00375].
  • Ограничения объема памяти из-за PerErrc::kOutOfStorageSpace или PerErrc::kTooManyFiles при превышении сконфигурированной верхней границы файла [SWS_PER_00375].
  • Ошибки целостности и безопасности, такие как PerErrc::kPhysicalStorageFailure, PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed или PerErrc::kAuthenticationFailed [SWS_PER_00375].

Во взаимодействии с другими интерфейсами FileStorage AUTOSAR предлагает альтернативные перегрузки: OpenFileReadWrite может вызываться с явным OpenMode [SWS_PER_00113] или с дополнительной пользовательской областью памяти buffer (ara::core::Span<ara::core::Byte>), которая обеспечивает блочную буферизацию для ускорения повторяющихся мелких обращений [SWS_PER_00429].

Этот текст был сгенерирован ИИ и проверен на основе спецификации AUTOSAR.

Руководство разработчика реализации в подготовке (сложность I1)

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe PerErrc::kIllegalWrite rollback_semantics

Parameter (in)

ParameterBeschreibung
fileNameFile name of the file. May correspond to the PersistencyFile.file Name of a configured file.

Rückgabewert

TypBeschreibung
ara::core::Result<UniqueHandle< ReadWriteAccessor > >A Result containing a UniqueHandle for the file. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
AccessReturned if the File Storage is configured as read-only, or if it is configured as write-only-once and the key already exists.
PerErrc::kPhysicalStorageFailureno_rollback_semantics Returned if access to the physical storage fails.
PerErrc::kIntegrityCorruptedrollback_semantics Returned if stored data cannot be read because the structural integrity is corrupted.
PerErrc::kValidationFailedrollback_semantics Returned if the validity of stored data cannot be ensured.
PerErrc::kEncryptionFailedrollback_semantics Returned if the decryption of stored data fails.
PerErrc::kResourceBusyrollback_semantics Returned if the file is already open, or if DeleteFile, RecoverFile, or ResetFile with the same file name is currently being executed.
PerErrc::kOutOfStorageSpaceno_rollback_semantics Returned if the available physical storage space is insufficient for a new file.
PerErrc::kTooManyFilesrollback_semantics Returned if the number of files would get larger than the configured maxNumberOfFiles when the file is created.
PerErrc::kAuthenticationFailedrollback_semantics Returned if checking the MAC of stored data fails.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00375
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00375@rel:R25-11#879cde57
Content hash
879cde57
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00375
Status: valid/unmigrated Version: rel:R25-11#f465ec05 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00375@rel:R25-11#f465ec05
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#ff96f9722026-09-30
  • R19-11rel:R19-11#cc81c63c2026-10-14
  • R20-11rel:R20-11#1cfd91622026-10-14
  • R21-11rel:R21-11#32976f732026-10-14
  • R22-11rel:R22-11#8a4213d62026-10-14
  • R23-11rel:R23-11#c423d7112026-10-14
  • R24-11rel:R24-11#0b6d7d9b2026-10-14
  • R25-11rel:R25-11#f465ec052026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция OpenFileReadWrite [SWS_PER_00429] Upstream: RS_PER_00001, RS_PER_00004, RS_PER_00010, RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00127, RS_AP_00128, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00144, RS_AP_00159

ara::core::Result< UniqueHandle< ReadWriteAccessor > > OpenFileRead Write (ara::core::StringView fileName, OpenMode mode, ara::core::Span< ara::core::Byte > buffer) noexcept;

Opens a file of this File Storage for reading and writing with a user provided buffer. If not otherwise specified by the provided mode, the file is opened with the seek position set to the beginning (corresponding to kAtTheBeginning). The provided buffer will be used by the ReadWriteAccessor to implement block-wise reading and writing to speed up multiple small accesses to the file. If the file does not exist, it is created. The file will be closed when the returned UniqueHandle goes out of scope.

СОЗДАНО ИИ не проверено Модель: gemini-3.8-flash-medium · Усилие: medium · Температура: не регулируется · Промпт: 06577277e905 Происхождение Открытые вопросы (1)
переведено с немецкого руководстваgemini-3.8-flash-low · 2026-10-13 · Немецкий оригинал

Использование

Метод OpenFileReadWrite класса ara::per::FileStorage синхронно открывает файл для комбинированного чтения и записи с предоставлением пользовательского буфера [SWS_PER_00429]. Переданная область памяти buffer (в виде ara::core::Span<ara::core::Byte>) используется внутри ReadWriteAccessor для блочных операций чтения и записи с целью производительной обработки серий мелких обращений. Если указанный файл еще не существует, он автоматически создается заново; позиция в файле по умолчанию находится в начале (kAtTheBeginning), если иное не задано в переданном mode [SWS_PER_00429]. Файл закрывается, как только возвращенный в ara::core::Result дескриптор UniqueHandle выходит из своей области видимости. Интерпретация: базовая память переданного диапазона буфера, по-видимому, должна оставаться валидной на протяжении всего времени жизни UniqueHandle, так как аксессор ссылается на нее для блочного доступа. Вопрос Q-e0009b7de17e3597 (открытый)

Обработка ошибок и параллелизм

Функция специфицирована как noexcept, исключебно-безопасная (exception safe) и потокобезопасная [SWS_PER_00429]. При сбоях Result возвращает ошибки, специфичные для производителя, или определенные коды ошибок:

  • PerErrc::kResourceBusy: файл уже открыт или одновременно обрабатывается с помощью DeleteFile, RecoverFile либо ResetFile с тем же именем [SWS_PER_00429].
  • Access: область памяти сконфигурирована как read-only или определена как write-only-once и уже занята [SWS_PER_00429].
  • PerErrc::kInvalidOpenMode: переданный mode содержит недопустимую комбинацию признаков [SWS_PER_00429].
  • PerErrc::kOutOfStorageSpace или PerErrc::kTooManyFiles: физической памяти недостаточно для создания нового файла либо был бы превышен сконфигурированный лимит maxNumberOfFiles [SWS_PER_00429].
  • PerErrc::kPhysicalStorageFailure, PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed и PerErrc::kAuthenticationFailed: ошибки при доступе, при проверке целостности, MAC или валидации, а также при дешифровании [SWS_PER_00429].

Взаимодействие

Метод представляет собой оптимизированный по производительности вариант открытия для чтения/записи: в то время как [SWS_PER_00113] обрабатывает только имя файла и режим, а [SWS_PER_00375] — исключительно имя файла, [SWS_PER_00429] позволяет целенаправленно ускорить мелкие операции ввода-вывода через явный буфер памяти.

Этот текст был создан ИИ и основан на требованиях спецификации AUTOSAR.

Руководство разработчика реализации в подготовке (сложность I1)

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe PerErrc::kIllegalWrite rollback_semantics

Parameter (in)

ParameterBeschreibung
fileNameFile name of the file. May correspond to the PersistencyFile.file Name of a configured file.
modeMode with which the file shall be opened.
bufferMemory to be used for block-wise reading/writing.

Rückgabewert

TypBeschreibung
ara::core::Result<UniqueHandle< ReadWriteAccessor > >A Result containing a UniqueHandle for the file. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
AccessReturned if the File Storage is configured as read-only, or if it is configured as write-only-once and the key already exists.
PerErrc::kPhysicalStorageFailureno_rollback_semantics Returned if access to the physical storage fails.
PerErrc::kIntegrityCorruptedrollback_semantics Returned if stored data cannot be read because the structural integrity is corrupted.
PerErrc::kValidationFailedrollback_semantics Returned if the validity of stored data cannot be ensured.
PerErrc::kEncryptionFailedrollback_semantics Returned if the decryption of stored data fails.
PerErrc::kResourceBusyrollback_semantics Returned if the file is already open, or if DeleteFile, RecoverFile, or ResetFile with the same file name is currently being executed.
PerErrc::kOutOfStorageSpaceno_rollback_semantics Returned if the available physical storage space is insufficient for a new file.
PerErrc::kInvalidOpenModerollback_semantics Returned if the passed mode contains an invalid combination of modes.
PerErrc::kTooManyFilesrollback_semantics Returned if the number of files would get larger than the configured maxNumberOfFiles when the file is created.
PerErrc::kAuthenticationFailedrollback_semantics Returned if checking the MAC of stored data fails.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00429
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00429@rel:R25-11#a9c694ff
Content hash
a9c694ff
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00429
Status: valid/unmigrated Version: rel:R25-11#e9dd40b8 Versionshistorie & Revisions (1 transition, 7 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00429@rel:R25-11#e9dd40b8
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#380d9a532026-09-30
  • R20-11rel:R20-11#38b6d4692026-10-14
  • R21-11rel:R21-11#a276c7642026-10-14
  • R22-11rel:R22-11#359642092026-10-14
  • R23-11rel:R23-11#09bac95b2026-10-14
  • R24-11rel:R24-11#7891475a2026-10-14
  • R25-11rel:R25-11#e9dd40b82026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция OpenFileWriteOnly [SWS_PER_00115] Upstream: RS_PER_00001, RS_PER_00004, RS_PER_00010, RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00127, RS_AP_00128, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00144, RS_AP_00159

ara::core::Result< UniqueHandle< WriteAccessor > > OpenFileWriteOnly (ara::core::StringView fileName, OpenMode mode) noexcept;

Opens a file of this File Storage for writing with a defined mode. If not otherwise specified by the provided mode, the file is truncated (corresponding to k Truncate). If the file does not exist, it is created. The file will be closed when the returned UniqueHandle goes out of scope.

СОЗДАНО ИИ не проверено Модель: gemini-3.8-flash-medium · Усилие: medium · Температура: не регулируется · Промпт: cf72b60c71fb Происхождение
переведено с немецкого руководстваgemini-3.8-flash-low · 2026-10-13 · Немецкий оригинал

Использование

Метод OpenFileWriteOnly класса ara::per::FileStorage синхронно открывает файл для монопольной записи с определённым режимом доступа [SWS_PER_00115]. Если через параметр mode не указано иное, файл при этом усекается (соответственно kTruncate). Если файл ещё не существует, он создаётся заново. В качестве возвращаемого значения служит ara::core::Result<UniqueHandle<WriteAccessor>>; при выходе из области видимости UniqueHandle файл автоматически закрывается снова [SWS_PER_00115].

Обработка ошибок

В случае сбоя возвращаемый Result содержит специфические коды ошибок [SWS_PER_00115]: Access указывает на то, что хранилище защищено от записи или сконфигурировано как Write-Once, и ключ уже существует. PerErrc::kInvalidOpenMode сообщает о недопустимых комбинациях режимов, а PerErrc::kOutOfStorageSpace — о недостатке физического дискового пространства. Кроме того, могут возникать PerErrc::kTooManyFiles, PerErrc::kPhysicalStorageFailure, а также ошибки целостности и безопасности, такие как PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed или PerErrc::kAuthenticationFailed [SWS_PER_00115].

Параллелизм и ограничения

Функция спроектирована как потокобезопасная, а также безопасная относительно исключений (noexcept) [SWS_PER_00115]. Параллельные обращения к одному и тому же файлу завершаются ошибкой с кодом PerErrc::kResourceBusy, если файл уже открыт или одновременно выполняются такие операции, как DeleteFile, RecoverFile или ResetFile с тем же именем файла [SWS_PER_00115].

Взаимодействие

Наряду с этой функцией интерфейс предоставляет упрощённую перегрузку без параметра режима, которая по умолчанию работает с kTruncate [SWS_PER_00377], а также перегрузку с пользовательским буфером для обеспечения блочной записи в целях ускорения множества мелких обращений [SWS_PER_00431].

Данное указание по использованию было сгенерировано ИИ на основе спецификации.

Руководство разработчика реализации в подготовке (сложность I1)

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe PerErrc::kIllegalWrite rollback_semantics

Parameter (in)

ParameterBeschreibung
fileNameFile name of the file. May correspond to the PersistencyFile.file Name of a configured file.
modeMode with which the file shall be opened.

Rückgabewert

TypBeschreibung
ara::core::Result<UniqueHandle< WriteAccessor > >A Result containing a UniqueHandle for the file. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
AccessReturned if the File Storage is configured as read-only, or if it is configured as write-only-once and the key already exists.
PerErrc::kPhysicalStorageFailureno_rollback_semantics Returned if access to the physical storage fails.
PerErrc::kIntegrityCorruptedrollback_semantics Returned if stored data cannot be read because the structural integrity is corrupted.
PerErrc::kValidationFailedrollback_semantics Returned if the validity of stored data cannot be ensured.
PerErrc::kEncryptionFailedrollback_semantics Returned if the decryption of stored data fails.
PerErrc::kResourceBusyrollback_semantics Returned if the file is already open, or if DeleteFile, RecoverFile, or ResetFile with the same file name is currently being executed.
PerErrc::kOutOfStorageSpaceno_rollback_semantics Returned if the available physical storage space is insufficient for a new file.
PerErrc::kInvalidOpenModerollback_semantics Returned if the passed mode contains an invalid combination of modes.
PerErrc::kTooManyFilesrollback_semantics Returned if the number of files would get larger than the configured maxNumberOfFiles when the file is created.
PerErrc::kAuthenticationFailedrollback_semantics Returned if checking the MAC of stored data fails.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00115
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00115@rel:R25-11#00572213
Content hash
00572213
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00115
Status: valid/unmigrated Version: rel:R25-11#8d570d7b Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00115@rel:R25-11#8d570d7b
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#947090352026-09-30
  • R19-11rel:R19-11#a8c3f2cb2026-10-14
  • R20-11rel:R20-11#a4a01e002026-10-14
  • R21-11rel:R21-11#9d4cb3182026-10-14
  • R22-11rel:R22-11#94711d402026-10-14
  • R23-11rel:R23-11#e0aa47d82026-10-14
  • R24-11rel:R24-11#6c8c32a92026-10-14
  • R25-11rel:R25-11#8d570d7b2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция OpenFileWriteOnly [SWS_PER_00377] Upstream: RS_PER_00001, RS_PER_00004, RS_PER_00010, RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00127, RS_AP_00128, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00144, RS_AP_00159

ara::core::Result< UniqueHandle< WriteAccessor > > OpenFileWriteOnly (ara::core::StringView fileName) noexcept;

Opens a file of this File Storage for writing. The file is truncated (corresponding to kTruncate). If the file does not exist, it is created. The file will be closed when the returned UniqueHandle goes out of scope.

СОЗДАНО ИИ не проверено Модель: gemini-3.8-flash-medium · Усилие: medium · Температура: не регулируется · Промпт: fa6d3b80cd05 Происхождение
переведено с немецкого руководстваgemini-3.8-flash-low · 2026-10-13 · Немецкий оригинал

Использование

Синхронный метод OpenFileWriteOnly класса ara::per::FileStorage открывает файл исключительно для записи согласно [SWS_PER_00377]. Через параметр fileName он принимает имя целевого файла. Если файл не существует, он создается заново; уже существующий файл усекается (в соответствии с kTruncate) [SWS_PER_00377]. В качестве возвращаемого значения служит ara::core::Result, инкапсулирующий ara::per::UniqueHandle<WriteAccessor> при успешном завершении. Данный дескриптор автоматически закрывает файл по паттерну RAII, как только выходит из области видимости [SWS_PER_00377].

Обработка ошибок и параллелизм

Операция объявлена как noexcept, является исключебно-безопасной и потокобезопасной [SWS_PER_00377]. В случае ошибки Result содержит специфический код ошибки из PerErrc или ошибку, специфичную для производителя [SWS_PER_00377]:

  • PerErrc::kResourceBusy: файл уже открыт или одновременно обрабатывается с помощью DeleteFile, RecoverFile либо ResetFile.
  • PerErrc::kOutOfStorageSpace и PerErrc::kTooManyFiles: недостаточно физической памяти или превышено максимальное количество сконфигурированных файлов (maxNumberOfFiles).
  • PerErrc::kPhysicalStorageFailure, PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed или PerErrc::kAuthenticationFailed: ошибки при аппаратном доступе, а также при проверках целостности, валидации или дешифрования.

Взаимодействие

В то время как этот вариант жестко задает усечение, перегрузка с параметром OpenMode допускает иной режим открытия [SWS_PER_00115]. Для оптимизированных блочных операций записи с множеством мелких обращений доступна еще одна перегрузка с пользовательским буфером (ara::core::Span<ara::core::Byte>) [SWS_PER_00431].

Этот текст был сгенерирован ИИ на основе спецификации AUTOSAR Adaptive R25-11.

Руководство разработчика реализации в подготовке (сложность I1)

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe PerErrc::kIllegalWrite rollback_semantics

Parameter (in)

ParameterBeschreibung
fileNameFile name of the file. May correspond to the PersistencyFile.file Name of a configured file.

Rückgabewert

TypBeschreibung
ara::core::Result<UniqueHandle< WriteAccessor > >A Result containing a UniqueHandle for the file. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
AccessReturned if the File Storage is configured as read-only, or if it is configured as write-only-once and the key already exists.
PerErrc::kPhysicalStorageFailureno_rollback_semantics Returned if access to the physical storage fails.
PerErrc::kIntegrityCorruptedrollback_semantics Returned if stored data cannot be read because the structural integrity is corrupted.
PerErrc::kValidationFailedrollback_semantics Returned if the validity of stored data cannot be ensured.
PerErrc::kEncryptionFailedrollback_semantics Returned if the decryption of stored data fails.
PerErrc::kResourceBusyrollback_semantics Returned if the file is already open, or if DeleteFile, RecoverFile, or ResetFile with the same file name is currently being executed.
PerErrc::kOutOfStorageSpaceno_rollback_semantics Returned if the available physical storage space is insufficient for a new file.
PerErrc::kTooManyFilesrollback_semantics Returned if the number of files would get larger than the configured maxNumberOfFiles when the file is created.
PerErrc::kAuthenticationFailedrollback_semantics Returned if checking the MAC of stored data fails.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00377
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00377@rel:R25-11#55f011dd
Content hash
55f011dd
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00377
Status: valid/unmigrated Version: rel:R25-11#b93b741b Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00377@rel:R25-11#b93b741b
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#425765882026-09-30
  • R19-11rel:R19-11#19dcafc12026-10-14
  • R20-11rel:R20-11#65cfdd922026-10-14
  • R21-11rel:R21-11#070ae0fe2026-10-14
  • R22-11rel:R22-11#8d2829d82026-10-14
  • R23-11rel:R23-11#f1d4f46e2026-10-14
  • R24-11rel:R24-11#06a2d0b72026-10-14
  • R25-11rel:R25-11#b93b741b2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция OpenFileWriteOnly [SWS_PER_00431] Upstream: RS_PER_00001, RS_PER_00004, RS_PER_00010, RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00127, RS_AP_00128, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00144, RS_AP_00159

ara::core::Result< UniqueHandle< WriteAccessor > > OpenFileWriteOnly (ara::core::StringView fileName, OpenMode mode, ara::core::Span< ara::core::Byte > buffer) noexcept;

Opens a file of this File Storage for writing with a user provided buffer. If not otherwise specified by the provided mode, the file is truncated (corresponding to k Truncate). The provided buffer will be used by the ReadWriteAccessor to implement block-wise writing to speed up multiple small accesses to the file. If the file does not exist, it is created. The file will be closed when the returned UniqueHandle goes out of scope.

СОЗДАНО ИИ не проверено Модель: gemini-3.8-flash-medium · Усилие: medium · Температура: не регулируется · Промпт: 37dc6b2848d7 Происхождение
переведено с немецкого руководстваgemini-3.8-flash-low · 2026-10-13 · Немецкий оригинал

Синхронный метод OpenFileWriteOnly класса ara::per::FileStorage открывает файл исключительно для записи и при успешном завершении возвращает ara::core::Result<UniqueHandle<WriteAccessor>> [SWS_PER_00431]. При выходе возвращенного UniqueHandle из области видимости открытый файл автоматически закрывается [SWS_PER_00431]. Вызов принимает, помимо имени файла fileName и режима доступа mode, пользовательский буфер buffer (в виде ara::core::Span<ara::core::Byte>), который используется для блочной записи с целью ускорения повторяющихся мелких обращений на запись [SWS_PER_00431]. Если в режиме не сконфигурировано иное, файл усекается при открытии (в соответствии с kTruncate); если он еще не существует, он создается заново [SWS_PER_00431].

С точки зрения параллелизма и безопасности метод специфицирован как thread-safe и exception safe, а также объявлен как noexcept [SWS_PER_00431]. Однако доступ завершается сбоем, если файл уже открыт или одновременно с тем же именем файла выполняются операции управления, такие как DeleteFile, RecoverFile или ResetFile [SWS_PER_00431].

В случае ошибки соответствующий код ошибки из PerErrc или ошибка, специфичная для производителя, возвращается в результате [SWS_PER_00431]:

  • PerErrc::kResourceBusy: файл уже открыт или занят другой операцией с файлом [SWS_PER_00431].
  • PerErrc::kIllegalWriteAccess: хранилище File Storage защищено от записи или сконфигурировано как write-only-once, и файл уже существует [SWS_PER_00431].
  • PerErrc::kInvalidOpenMode: переданная комбинация режимов недопустима [SWS_PER_00431].
  • PerErrc::kOutOfStorageSpace или PerErrc::kTooManyFiles: недостаточно места в памяти или превышено максимальное количество сконфигурированных файлов [SWS_PER_00431].
  • PerErrc::kPhysicalStorageFailure, PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed или PerErrc::kAuthenticationFailed: ошибки при физическом доступе, проверке целостности, валидации, дешифровании или аутентификации [SWS_PER_00431].

Во взаимодействии с другими интерфейсами функция целенаправленно расширяет базовые методы [SWS_PER_00377] (только fileName) и [SWS_PER_00115] (с mode) поддержкой буфера для оптимизированных процессов записи [SWS_PER_00431].

Данное указание по использованию сгенерировано автоматически на основе спецификации AUTOSAR R25-11.

Руководство разработчика реализации в подготовке (сложность I1)

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
fileNameFile name of the file. May correspond to the PersistencyFile.file Name of a configured file.
modeMode with which the file shall be opened.
bufferMemory to be used for block-wise writing.

Rückgabewert

TypBeschreibung
ara::core::Result<UniqueHandle< WriteAccessor > >A Result containing a UniqueHandle for the file. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
PerErrc::kIllegalWriteAccessrollback_semantics Returned if the File Storage is configured as read-only, or if it is configured as write-only-once and the key already exists.
PerErrc::kPhysicalStorageFailureno_rollback_semantics Returned if access to the physical storage fails.
PerErrc::kIntegrityCorruptedrollback_semantics Returned if stored data cannot be read because the structural integrity is corrupted.
PerErrc::kValidationFailedrollback_semantics Returned if the validity of stored data cannot be ensured.
PerErrc::kEncryptionFailedrollback_semantics Returned if the decryption of stored data fails.
PerErrc::kResourceBusyrollback_semantics Returned if the file is already open, or if DeleteFile, RecoverFile, or ResetFile with the same file name is currently being executed.
PerErrc::kOutOfStorageSpaceno_rollback_semantics Returned if the available physical storage space is insufficient for a new file.
PerErrc::kInvalidOpenModerollback_semantics Returned if the passed mode contains an invalid combination of modes.
PerErrc::kTooManyFilesrollback_semantics Returned if the number of files would get larger than the configured maxNumberOfFiles when the file is created.
PerErrc::kAuthenticationFailedrollback_semantics Returned if checking the MAC of stored data fails.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00431
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00431@rel:R25-11#3b654fab
Content hash
3b654fab
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00431
Status: valid/unmigrated Version: rel:R25-11#3f1ccf51 Versionshistorie & Revisions (1 transition, 7 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00431@rel:R25-11#3f1ccf51
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#4a5239432026-09-30
  • R20-11rel:R20-11#cee86b4c2026-10-14
  • R21-11rel:R21-11#97f9954b2026-10-14
  • R22-11rel:R22-11#950e84fd2026-10-14
  • R23-11rel:R23-11#26aeb4402026-10-14
  • R24-11rel:R24-11#e7c640db2026-10-14
  • R25-11rel:R25-11#3f1ccf512026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция RecoverFile [SWS_PER_00337] Upstream: RS_PER_00001, RS_PER_00004, RS_PER_00009, RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00127, RS_AP_00128, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00159

ara::core::Result< void > RecoverFile (ara::core::StringView fileName) noexcept;

Recovers a file of this File Storage. This method allows to recover a single file when the redundancy checks fail. It will fail with kResourceBusy when the file is currently open. This method does a best-effort recovery of the file. After recovery, the file might show outdated or initial content, or might be lost.

СОЗДАНО ИИ не проверено Модель: gemini-3.8-flash-medium · Усилие: medium · Температура: не регулируется · Промпт: 1adb8f07ad8e Происхождение
переведено с немецкого руководстваgemini-3.8-flash-low · 2026-10-13 · Немецкий оригинал

Использование

Синхронный метод RecoverFile класса ara::per::FileStorage выполняет best-effort восстановление отдельного файла, если проверки избыточности завершаются неудачно [SWS_PER_00337]. Идентификатор затронутого файла передается через параметр fileName как ara::core::StringView. После восстановления файл может содержать устаревшие данные, начальное содержимое или, в худшем случае, быть утраченным [SWS_PER_00337].

Параллелизм и взаимодействие

Операция специфицирована как потокобезопасная и безопасная к исключениям [SWS_PER_00337]. Однако ее нельзя выполнять над открытыми файлами: перед вызовом все экземпляры UniqueHandle, полученные ранее через методы открытия файлов, такие как [SWS_PER_00113], [SWS_PER_00114] или [SWS_PER_00375], должны быть закрыты [SWS_PER_00337]. В противном случае вызов завершается неудачно с PerErrc::kResourceBusy. Та же ошибка возвращается, если одновременно выполняется [SWS_PER_00111] (DeleteFile) или [SWS_PER_00338] (ResetFile) для того же имени файла [SWS_PER_00337].

Обработка ошибок

Функция возвращает ara::core::Result<void> [SWS_PER_00337]. Помимо PerErrc::kResourceBusy, могут возникать следующие стандартизированные ошибки:

  • PerErrc::kFileNotFound: указанный файл не существует в файловом хранилище [SWS_PER_00337].
  • PerErrc::kPhysicalStorageFailure: доступ к физическому носителю данных завершается сбоем [SWS_PER_00337].
  • PerErrc::kOutOfStorageSpace: доступного физического дискового пространства недостаточно для восстановленного файла [SWS_PER_00337].
  • PerErrc::kQuotaExceeded: восстановленный файл превысил бы сконфигурированный лимит maximumAllowedSize [SWS_PER_00337].
  • PerErrc::kEncryptionFailed и PerErrc::kAuthenticationFailed: криптографическое дешифрование или проверка MAC сохраненных данных завершились неудачно [SWS_PER_00337].

Это указание по использованию было автоматически сгенерировано на основе спецификации AUTOSAR R25-11.

Руководство разработчика реализации в подготовке (сложность I2)

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe PerErrc::kPhysical no_rollback_semantics

Parameter (in)

ParameterBeschreibung
fileNameFile name of the file. May correspond to the PersistencyFile.file Name of a configured file.

Rückgabewert

TypBeschreibung
ara::core::Result< void >A Result of void. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
StorageFailureReturned if access to the physical storage fails.
PerErrc::kEncryptionFailedrollback_semantics Returned if the encryption or decryption of stored data fails.
PerErrc::kResourceBusyrollback_semantics Returned if the file is open, or if DeleteFile or ResetFile with the same file name is currently being executed.
PerErrc::kOutOfStorageSpaceno_rollback_semantics Returned if the available physical storage space is insufficient for the recovered file.
PerErrc::kFileNotFoundrollback_semantics Returned if the provided file does not exist in the File Storage.
PerErrc::kQuotaExceededrollback_semantics Returned if the recovered file would exceed the configured maximumAllowedSize of the File Storage.
PerErrc::kAuthenticationFailedrollback_semantics Returned if calculating or checking the MAC of stored data fails.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00337
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00337@rel:R25-11#f2620496
Content hash
f2620496
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00337
Status: valid/unmigrated Version: rel:R25-11#bc734b10 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00337@rel:R25-11#bc734b10
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#197d86622026-09-30
  • R19-11rel:R19-11#c81267f62026-10-14
  • R20-11rel:R20-11#e1325f5e2026-10-14
  • R21-11rel:R21-11#7b0aeab52026-10-14
  • R22-11rel:R22-11#55f9192b2026-10-14
  • R23-11rel:R23-11#44af99602026-10-14
  • R24-11rel:R24-11#b7a26e732026-10-14
  • R25-11rel:R25-11#bc734b102026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция ResetFile [SWS_PER_00338] Upstream: RS_PER_00001, RS_PER_00004, RS_PER_00009, RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00127, RS_AP_00128, RS_AP_00129, RS_AP_00135, RS_AP_00139, RS_AP_00159

ara::core::Result< void > ResetFile (ara::core::StringView fileName) noexcept;

Resets a file of this File Storage to its initial content. ResetFile allows to reset a single file to its initial content. If the file is currently not available in the File Storage, it is re-created. Afterwards, the file will appear in both cases as if it was newly installed from the current Target Configuration. It will fail with kResourceBusy when the file is currently open, and with kInitValueNotAvailable when neither Application Design nor Target Configuration define an initial content for the file.

СОЗДАНО ИИ не проверено Модель: gemini-3.8-flash-medium · Усилие: medium · Температура: не регулируется · Промпт: 16bebc8c99d8 Происхождение
переведено с немецкого руководстваgemini-3.8-flash-low · 2026-10-13 · Немецкий оригинал

Синхронный метод ResetFile класса ara::per::FileStorage сбрасывает отдельный файл в его предварительно сконфигурированное исходное состояние [SWS_PER_00338]. Если указанный через fileName файл еще не существует в хранилище, он создается заново [SWS_PER_00338]. В обоих случаях файл после этого имеет такое же содержимое, как после новой установки из текущей конфигурации Target Configuration [SWS_PER_00338]; его состояние изменения ведется в FileModificationState как kModifiedDuringReset [SWS_PER_00436].

Операция является потокобезопасной, а также безопасной к исключениям и синхронно возвращает ara::core::Result<void> [SWS_PER_00338]. Она завершается с ошибкой PerErrc::kResourceBusy, если файл открыт в данный момент — например, через [SWS_PER_00113] — или одновременно выполняется [SWS_PER_00111] либо [SWS_PER_00337] с тем же именем файла [SWS_PER_00338].

Кроме того, интерфейс определяет конкретные случаи ошибок [SWS_PER_00338]:

  • PerErrc::kInitValueNotAvailable: начальное значение не сконфигурировано ни в Application Design, ни в Target Configuration [SWS_PER_00338].
  • PerErrc::kQuotaExceeded или PerErrc::kTooManyFiles: восстановленный файл превысил бы лимит AllowedSize или maxNumberOfFiles [SWS_PER_00338].
  • PerErrc::kOutOfStorageSpace или StorageFailure: физического пространства памяти недостаточно либо физический доступ завершается неудачно [SWS_PER_00338].
  • PerErrc::kEncryptionFailed или PerErrc::kAuthenticationFailed: сбой шифрования/дешифрования либо проверки MAC сохраненных данных [SWS_PER_00338].

Данное указание по использованию создано ИИ и основано на спецификации AUTOSAR Adaptive R25-11.

Руководство разработчика реализации в подготовке (сложность I2)

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe PerErrc::kPhysical no_rollback_semantics

Parameter (in)

ParameterBeschreibung
fileNameFile name of the file. May correspond to the PersistencyFile.file Name of a configured file.

Rückgabewert

TypBeschreibung
ara::core::Result< void >A Result of void. In case of an error, it contains any of the errors defined below, or a vendor specific error.

Fehler

FehlercodeBeschreibung
StorageFailureReturned if access to the physical storage fails.
PerErrc::kEncryptionFailedrollback_semantics Returned if the encryption or decryption of stored data fails.
PerErrc::kInitValueNotAvailablerollback_semantics Returned if no intitial value was configured for this file.
PerErrc::kResourceBusyrollback_semantics Returned if the file is open, or if DeleteFile or RecoverFile with the same file name is currently being executed.
PerErrc::kOutOfStorageSpaceno_rollback_semantics Returned if the available physical storage space is insufficient for the initial file.
PerErrc::kTooManyFilesrollback_semantics Returned if the number of files would get larger than the configured maxNumberOfFiles when the file is restored.
PerErrc::kQuotaExceededrollback_semantics Returned if the initial file would exceed the configured maximum AllowedSize of the File Storage.
PerErrc::kAuthenticationFailedrollback_semantics Returned if calculating or checking the MAC of stored data fails.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00338
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00338@rel:R25-11#f05e1cbe
Content hash
f05e1cbe
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00338
Status: valid/unmigrated Version: rel:R25-11#0e854863 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00338@rel:R25-11#0e854863
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#e0bc7dbf2026-09-30
  • R19-11rel:R19-11#374792432026-10-14
  • R20-11rel:R20-11#447c2e0a2026-10-14
  • R21-11rel:R21-11#3249eca82026-10-14
  • R22-11rel:R22-11#5318b4ac2026-10-14
  • R23-11rel:R23-11#7d4afee22026-10-14
  • R24-11rel:R24-11#e91250742026-10-14
  • R25-11rel:R25-11#0e8548632026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция operator= [SWS_PER_00327] Upstream: RS_PER_00004, RS_AP_00119, RS_AP_00120, RS_AP_00121, RS_AP_00145, RS_AP_00159

FileStorage & operator= (FileStorage &&fs)=delete;

The move assignment operator for FileStorage shall not be used.

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00327
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00327@rel:R25-11#4c3ea5ec
Content hash
4c3ea5ec
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00327
Status: valid/unmigrated Version: rel:R25-11#cfa00f65 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00327@rel:R25-11#cfa00f65
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#d0dd99c82026-09-30
  • R19-11rel:R19-11#c719ee8c2026-10-14
  • R20-11rel:R20-11#dbca66992026-10-14
  • R21-11rel:R21-11#b28a2eda2026-10-14
  • R22-11rel:R22-11#07630f652026-10-14
  • R23-11rel:R23-11#61a2cece2026-10-14
  • R24-11rel:R24-11#cfa00f652026-10-14
  • R25-11rel:R25-11#cfa00f652026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция operator= [SWS_PER_00329] Upstream: RS_PER_00004, RS_AP_00119, RS_AP_00120, RS_AP_00145

FileStorage & operator= (const FileStorage &)=delete;

The copy assignment operator for FileStorage shall not be used.

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00329
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00329@rel:R25-11#9b0ac351
Content hash
9b0ac351
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00329
Status: valid/unmigrated Version: rel:R25-11#b7444c9a Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00329@rel:R25-11#b7444c9a
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#24fb36102026-09-30
  • R19-11rel:R19-11#08d210462026-10-14
  • R20-11rel:R20-11#b39d46862026-10-14
  • R21-11rel:R21-11#b39d46862026-10-14
  • R22-11rel:R22-11#8e424eeb2026-10-14
  • R23-11rel:R23-11#9211a8ba2026-10-14
  • R24-11rel:R24-11#b7444c9a2026-10-14
  • R25-11rel:R25-11#b7444c9a2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

функция ~FileStorage [SWS_PER_00330] Upstream: RS_PER_00004, RS_AP_00120, RS_AP_00129, RS_AP_00134, RS_AP_00145, RS_AP_00159

~FileStorage () noexcept;

Destructor for FileStorage.

Header-Datei#include "ara/per/file_storage.h"
Scopeclass ara::per::FileStorage
Exception-Sicherheitexception safe
Thread-Sicherheitnot thread-safe

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_PER_00330
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_PER_00330@rel:R25-11#2b6fe954
Content hash
2b6fe954
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Persistency.pdf#nameddest=SWS_PER_00330
Status: valid/unmigrated Version: rel:R25-11#406daa83 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_PER_00330@rel:R25-11#406daa83
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#a52467262026-09-30
  • R19-11rel:R19-11#f78017fc2026-10-14
  • R20-11rel:R20-11#0c5e9d812026-10-14
  • R21-11rel:R21-11#0c5e9d812026-10-14
  • R22-11rel:R22-11#888777422026-10-14
  • R23-11rel:R23-11#83343bdb2026-10-14
  • R24-11rel:R24-11#406daa832026-10-14
  • R25-11rel:R25-11#406daa832026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill