DEENESPTFRRUARHIKOZHNL

classe 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

Guia do utilizadorGERADO POR IA

Gerencia arquivos persistentes e os abre por meio de manipuladores baseados em RAII para leitura e escrita em blocos.
GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 7736cf7ccbd1 Procedência Perguntas em aberto (2)
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

Gerencia arquivos persistentes e os abre por meio de manipuladores baseados em RAII para leitura e escrita em blocos.

A classe ara::per::FileStorage permite gerenciar e abrir um conjunto de arquivos persistentes configurados por meio de nomes de arquivo exclusivos [SWS_PER_00110]. O acesso real de leitura e escrita ocorre por meio de acessadores guiados por UniqueHandle, que fecham o arquivo novamente de forma automática ao sair do escopo [SWS_PER_00114]. Como arquivos já abertos estão protegidos contra operações concorrentes de exclusão ou recuperação, esses acessos paralelos falham com PerErrc::kResourceBusy [SWS_PER_00111].

Contexto

A classe ara::per::FileStorage encapsula o acesso a uma coleção configurada de arquivos persistentes identificados por nomes de arquivo exclusivos. Ela atua como interface central para aplicações realizarem operações de arquivo, como a listagem de arquivos existentes por meio de GetAllFileNames [SWS_PER_00110], a verificação de existência através de FileExists [SWS_PER_00112], bem como a consulta de metadados e tamanhos de arquivo via GetFileInfo [SWS_PER_00438] e GetCurrentFileSize [SWS_PER_00407]. O acesso direto de leitura ou escrita no nível de bytes não ocorre na própria instância de armazenamento, mas sim intermediado por objetos acessadores especiais, fornecidos como UniqueHandle pelos métodos de abertura [SWS_PER_00114] [SWS_PER_00113] [SWS_PER_00115].

Ciclo de vida

A instanciação de FileStorage está sujeita a restrições estritas: tanto o construtor padrão [SWS_PER_00460] quanto os construtores de cópia e movimento [SWS_PER_00328] [SWS_PER_00326], bem como os operadores de atribuição por cópia e movimento [SWS_PER_00329] [SWS_PER_00327], estão explicitamente excluídos. Supõe-se, portanto, que uma instância de FileStorage seja tipicamente aberta e disponibilizada por meio de funções de fábrica do módulo de persistência no lado da plataforma. Pergunta (aberta) O destrutor ~FileStorage é seguro quanto a exceções (noexcept), mas especificado explicitamente como não seguro para threads [SWS_PER_00330], razão pela qual deve-se assegurar que nenhuma chamada concorrente ocorra no objeto durante a destruição.

Em operação normal, as operações de arquivo regulares, tais como FileExists, DeleteFile ou a abertura de arquivos, são projetadas para serem seguras para threads [SWS_PER_00111] [SWS_PER_00112] [SWS_PER_00114]. No entanto, deve-se observar que os resultados de consultas de status como GetAllFileNames [SWS_PER_00110] ou FileExists [SWS_PER_00112] só possuem validade precisa se arquivos não forem adicionados ou excluídos simultaneamente em outra thread. O mesmo se aplica a GetFileInfo: tempos de modificação e acesso, bem como o status de edição, só são confiavelmente precisos enquanto o arquivo de destino não estiver aberto [SWS_PER_00438].

Caminho de utilização

Um caminho de uso típico abrange a verificação, a abertura direcionada, o processamento de dados por meio do manipulador do acessador e a limpeza final:

  1. Verificar o status do arquivo: Antes do acesso, pode-se opcionalmente verificar via FileExists se um arquivo desejado existe [SWS_PER_00112], ou consultar os arquivos existentes por meio de GetAllFileNames [SWS_PER_00110].
  2. Abrir o arquivo: Dependendo do modo de acesso pretendido, a classe fornece métodos dedicados. Para acesso somente de leitura, estão disponíveis sobrecargas de OpenFileReadOnly [SWS_PER_00114] [SWS_PER_00376] [SWS_PER_00430]. Para acesso de leitura e escrita, serve OpenFileReadWrite [SWS_PER_00113] [SWS_PER_00375] [SWS_PER_00429], criando-se automaticamente um novo arquivo caso não exista. Para escrita pura, existe OpenFileWriteOnly [SWS_PER_00115] [SWS_PER_00377] [SWS_PER_00431], o qual trunca o arquivo por padrão (kTruncate) ou o cria de novo. Para aumento de desempenho em muitos acessos pequenos, as sobrecargas permitem a passagem de um buffer definido pelo usuário para leitura ou escrita em blocos [SWS_PER_00430] [SWS_PER_00429] [SWS_PER_00431].
  3. Fechar o arquivo e liberar recursos: O ara::core::Result retornado pelos métodos de abertura encapsula um UniqueHandle para o respectivo acessador. O arquivo é fechado automaticamente assim que esse UniqueHandle sai do seu escopo [SWS_PER_00114] [SWS_PER_00113] [SWS_PER_00115]. Presumivelmente, a marcação de ocupação referente ao arquivo em FileStorage também é liberada nessa ocasião. Pergunta (aberta)
  4. Manutenção e limpeza: Arquivos não mais necessários são excluídos com DeleteFile [SWS_PER_00111]. Em caso de violações de integridade, RecoverFile oferece uma recuperação de melhor esforço de dados redundantes [SWS_PER_00337], enquanto ResetFile redefine um arquivo para o seu conteúdo de disponibilização inicial ou o cria novamente em caso de ausência [SWS_PER_00338].
Caminho de uso típico para FileStorageAplicaçãostorage: FileStoragehandle: UniqueHandleUse Case: 1. Verificação préviaFileExists(fileName)Result<bool> (true)Use Case: 2. Abrir arquivoOpenFileReadOnly(fileName, mode, buffer)Result<UniqueHandle<ReadAccessor>>Use Case: 3. Dateiinhalt lesenLeitura em blocos via AccessorGelesene Byte-DatenUse Case: 4. Fechar ao término do escopoUniqueHandle sai do escopoDestrutor fecha o arquivoUse Case: 5. BereinigungDeleteFile(fileName)Result<void>

Diagrama de sequência: fluxo típico desde a verificação e abertura de um arquivo até o fechamento automático pelo escopo do manipulador, passando pelo processamento de buffers. Fontes: [SWS_PER_00112], [SWS_PER_00430], [SWS_PER_00114], [SWS_PER_00111].

Cenários de erro

Os métodos de FileStorage sinalizam erros por meio de ara::core::Result utilizando o enum de erro PerErrc. Entre as situações de erro mais importantes estão:

  • Conflitos de recursos (PerErrc::kResourceBusy): Um arquivo não pode ser aberto, excluído, recuperado ou redefinido se já estiver aberto ou se um DeleteFile, RecoverFile ou ResetFile estiver sendo executado em paralelo sobre o mesmo nome de arquivo [SWS_PER_00111] [SWS_PER_00114] [SWS_PER_00113] [SWS_PER_00337] [SWS_PER_00338].
  • Arquivos não encontrados (PerErrc::kFileNotFound): Ocorre quando um arquivo não existente deve ser aberto para leitura pura [SWS_PER_00114], excluído [SWS_PER_00111], consultado [SWS_PER_00407] [SWS_PER_00438] ou recuperado [SWS_PER_00337].
  • Violações de acesso e permissão: Aberturas para escrita ou processos de exclusão falham com PerErrc::kIllegalWriteAccess caso o armazenamento esteja configurado como protegido contra escrita (read-only) [SWS_PER_00111] [SWS_PER_00113] [SWS_PER_00115]. Combinações de modo inválidas são rejeitadas com PerErrc::kInvalidOpenMode [SWS_PER_00114] [SWS_PER_00113].
  • Limites de armazenamento e cotas: Na criação de novo arquivo ou aumento de tamanho, podem ocorrer PerErrc::kOutOfStorageSpace (memória física cheia), PerErrc::kTooManyFiles (superação de maxNumberOfFiles) ou PerErrc::kQuotaExceeded (ultrapassagem de maximumAllowedSize) [SWS_PER_00113] [SWS_PER_00337] [SWS_PER_00338].
  • Erros de integridade e segurança: Em caso de falhas na camada física de armazenamento, PerErrc::kPhysicalStorageFailure é reportado. Estruturas de dados corrompidas, validações com falha ou problemas de criptografia resultam em PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed ou PerErrc::kAuthenticationFailed [SWS_PER_00110] [SWS_PER_00112] [SWS_PER_00114] [SWS_PER_00337].
  • Dados iniciais ausentes (PerErrc::kInitValueNotAvailable): Falha na redefinição via ResetFile quando não houver valores iniciais definidos nem no Application Design nem na configuração de destino [SWS_PER_00338].

Este guia baseia-se na especificação AUTOSAR Adaptive Platform Release R25-11 e resume os requisitos funcionais para ara::per::FileStorage.

Mapa de membros

Diagrama de classes

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()

Vista de detalhes

Selecione uma entrada no índice.

Construtores e destrutor

FileStorage função 3

The move constructor for FileStorage shall not be used.

Sobrecargas FileStorage 3
FileStorage (FileStorage &&fs)=delete; SWS_PER_00326
FileStorage (const FileStorage &)=delete; SWS_PER_00328
FileStorage ()=delete; SWS_PER_00460
~FileStorage função

Destructor for FileStorage.

~FileStorage () noexcept;

Métodos

DeleteFile função

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 função

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;

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;

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 função

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 função 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.

Sobrecargas OpenFileReadOnly 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.

Sobrecargas OpenFileReadWrite 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.

Sobrecargas OpenFileWriteOnly 3
RecoverFile função

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 função

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;

Operadores

operator= função 2

The move assignment operator for FileStorage shall not be used.

Sobrecargas = 2
FileStorage & operator= (FileStorage &&fs)=delete; SWS_PER_00327
FileStorage & operator= (const FileStorage &)=delete; SWS_PER_00329

Documentação dos métodos

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 4416a2cc7c72 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

O método síncrono DeleteFile da classe ara::per::FileStorage remove um ficheiro a partir do seu nome (fileName) do armazenamento de ficheiros [SWS_PER_00111]. O identificador pode corresponder ao PersistencyFile.fileName configurado [SWS_PER_00111]. A chamada está especificada como noexcept, é considerada segura contra exceções e segura para threads, e reporta o resultado através de ara::core::Result<void> [SWS_PER_00111].

Antes da chamada, todos os acessos ativos ao ficheiro de destino têm de estar terminados. Se o ficheiro estiver atualmente aberto, a operação de eliminação falha com o erro PerErrc::kResourceBusy [SWS_PER_00111]. Por conseguinte, as aplicações têm de garantir que instâncias de UniqueHandle anteriormente criadas através de OpenFileReadWrite [SWS_PER_00113], OpenFileReadOnly [SWS_PER_00114] ou OpenFileWriteOnly [SWS_PER_00115] tenham saído do seu âmbito, fechando assim o ficheiro. Da mesma forma, uma execução paralela de RecoverFile [SWS_PER_00337] ou ResetFile [SWS_PER_00338] para o mesmo nome de ficheiro resulta em PerErrc::kResourceBusy [SWS_PER_00111].

Em caso de erro, o tipo Result retornado disponibiliza causas de erro específicas [SWS_PER_00111]:

  • PerErrc::kFileNotFound: o arquivo especificado não existe no armazenamento de arquivos [SWS_PER_00111].
  • PerErrc::kIllegalWriteAccess: O File Storage está configurado como protegido contra escrita [SWS_PER_00111].
  • PerErrc::kPhysicalStorageFailure: O acesso ao suporte de armazenamento físico falha (sem semântica de rollback) [SWS_PER_00111].
  • PerErrc::kIntegrityCorrupted, PerErrc::kEncryptionFailed ou PerErrc::kAuthenticationFailed: Falha na integridade estrutural, na encriptação/desencriptação ou na verificação de MAC (cada uma com semântica de rollback), bem como erros específicos do fabricante [SWS_PER_00111].

Este texto foi gerado por uma IA e serve como orientação. Apenas as especificações da documentação da AUTOSAR são vinculativas.

Guia do implementador em breve (complexidade 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#47287e79
Content hash
47287e79
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: f0bea0a79212 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

O método síncrono FileExists da classe ara::per::FileStorage verifica se um ficheiro existe no respetivo armazenamento de ficheiros [SWS_PER_00112]. A função está declarada como noexcept e não lança exceções C++ [SWS_PER_00112].

usar

Como parâmetro é transmitido fileName como ara::core::StringView, o que pode corresponder ao identificador PersistencyFile.fileName de um ficheiro configurado [SWS_PER_00112]. O valor de retorno ara::core::Result<bool> devolve true se o ficheiro tiver sido localizado e, caso contrário, false [SWS_PER_00112].

Tratamento de erros

Se a verificação falhar, o Result devolvido não contém um valor booleano, mas sim um código de erro [SWS_PER_00112]. As causas de erro especificadas são:

  • PerErrc::kPhysicalStorageFailure em caso de falha no acesso ao armazenamento físico [SWS_PER_00112],
  • PerErrc::kIntegrityCorrupted em caso de integridade estrutural danificada dos dados [SWS_PER_00112],
  • PerErrc::kValidationFailed se a validade dos dados armazenados não puder ser garantida [SWS_PER_00112],
  • PerErrc::kEncryptionFailed em caso de falha na desencriptação [SWS_PER_00112],
  • PerErrc::kAuthenticationFailed em caso de falha na verificação do MAC [SWS_PER_00112], bem como possíveis erros específicos do fabricante [SWS_PER_00112].

Simultaneidade e restrições

O método está declarado como seguro para threads [SWS_PER_00112]. No entanto, o resultado de verificação fornecido só é exato enquanto não forem adicionados ou eliminados ficheiros no armazenamento em simultâneo; se, por exemplo, outra thread remover um ficheiro diretamente após o retorno de true, o resultado já não é válido [SWS_PER_00112].

Esta nota de uso foi gerada automaticamente com base no AUTOSAR R25-11.

Guia do implementador em breve (complexidade 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#508ed93d
Content hash
508ed93d
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

função 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#0bc4b355
Content hash
0bc4b355
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

função 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#e4fd86d2
Content hash
e4fd86d2
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

função 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#2ead436f
Content hash
2ead436f
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

função 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#65a51b39
Content hash
65a51b39
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

função 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#b00df37e
Content hash
b00df37e
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

função 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#752a1024
Content hash
752a1024
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: b7f6df93c4d9 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

O método OpenFileReadOnly da classe ara::per::FileStorage (declarado em #include "ara/per/file_storage.h") abre um arquivo persistido somente para leitura com um modo de acesso especificado [SWS_PER_00114]. A menos que especificado de outra forma por meio do parâmetro mode, a posição do ponteiro de leitura é definida por padrão para o início do arquivo (kAtTheBeginning) [SWS_PER_00114]. A execução ocorre de forma síncrona e retorna um ara::core::Result<UniqueHandle<ReadAccessor>>. O handle utiliza semântica RAII: assim que a instância de UniqueHandle sai de seu escopo, o arquivo é automaticamente fechado [SWS_PER_00114].

Em relação à concorrência, o método é especificado como thread-safe e exception safe (com noexcept) [SWS_PER_00114]. Contudo, existem restrições funcionais de chamada: se o arquivo de destino já estiver aberto ou se operações como DeleteFile, RecoverFile ou ResetFile estiverem sendo executadas concorrentemente com o mesmo nome de arquivo, a chamada falhará com PerErrc::kResourceBusy [SWS_PER_00114].

Em caso de erro, o ara::core::Result retorna erros específicos do fabricante ou códigos de erro padronizados de PerErrc ou StorageFailure [SWS_PER_00114]:

  • PerErrc::kFileNotFound: o arquivo especificado não existe no armazenamento de arquivos [SWS_PER_00114].
  • PerErrc::kInvalidOpenMode: o modo fornecido contém uma combinação inválida de flags [SWS_PER_00114].
  • StorageFailure: o acesso ao armazenamento físico falhou [SWS_PER_00114].
  • PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kAuthenticationFailed ou PerErrc::kEncryptionFailed: integridade estrutural corrompida, validação insuficiente, falha na verificação de MAC ou falha na descriptografia [SWS_PER_00114].

Em conjunto com outras interfaces, FileStorage oferece duas sobrecargas relacionadas: uma variante sem parâmetro de modo, que sempre abre no início do arquivo [SWS_PER_00376], e uma sobrecarga com buffer (ara::core::Span<ara::core::Byte> buffer), por meio da qual o ReadAccessor implementa leitura em blocos para acelerar muitos acessos pequenos [SWS_PER_00430].

Esta nota de utilização foi gerada automaticamente com base na especificação da AUTOSAR Adaptive R25-11.

Guia do implementador em breve (complexidade 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#c8420e2d
Content hash
c8420e2d
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 4286b0e81322 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

usar

O método OpenFileReadOnly da classe ara::per::FileStorage abre um ficheiro persistido em modo de apenas leitura [SWS_PER_00376]. A chamada é realizada através do ficheiro de cabeçalho ara/per/file_storage.h passando o nome do ficheiro fileName. A posição de leitura é inicialmente colocada no início do ficheiro. Como valor de retorno serve um ara::core::Result, que disponibiliza um UniqueHandle<ReadAccessor> em caso de sucesso. O ficheiro aberto é fechado automaticamente assim que este identificador sai do seu âmbito.

Tratamento de erros

Se a execução falhar, o resultado contém um código de erro ou um erro específico do fabricante [SWS_PER_00376]:

  • PerErrc::kFileNotFound: O ficheiro especificado não existe no armazenamento.
  • PerErrc::kResourceBusy: O ficheiro já está aberto ou está a ser processado simultaneamente por DeleteFile, RecoverFile ou ResetFile.
  • PerErrc::kPhysicalStorageFailure: O acesso ao suporte de armazenamento físico falhou.
  • PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed, PerErrc::kAuthenticationFailed: Erro na integridade estrutural, validação de dados, desencriptação ou verificação de MAC.

Concorrência e interação

O método está especificado como thread-safe, exception safe e noexcept [SWS_PER_00376]. Para requisitos avançados estão disponíveis sobrecargas: uma variante para indicação explícita de um OpenMode [SWS_PER_00114], bem como uma assinatura com buffer de utilizador adicional para aceleração por blocos de pequenos acessos de leitura [SWS_PER_00430].

Esta nota de utilização foi criada de forma automatizada com base na especificação AUTOSAR.

Guia do implementador em breve (complexidade 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#c9ba1f30
Content hash
c9ba1f30
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: f3a0884b9d84 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

O método síncrono OpenFileReadOnly da classe ara::per::FileStorage abre um ficheiro persistido para acesso de leitura utilizando um buffer disponibilizado pelo chamador [SWS_PER_00430]. Com base nos parâmetros fileName, mode bem como buffer (como ara::core::Span<ara::core::Byte>), o acesso ao ficheiro é inicializado [SWS_PER_00430]. Salvo indicação em contrário através de mode, a posição de leitura situa-se por padrão no início do ficheiro (kAtTheBeginning) [SWS_PER_00430]. O espaço de memória transmitido é utilizado pelo ReadAccessor resultante para acelerar pequenos acessos de leitura repetidos através de leitura por blocos [SWS_PER_00430]. O recurso está protegido via RAII: assim que o UniqueHandle devolvido sai do âmbito, o ficheiro é automaticamente fechado [SWS_PER_00430].

No que diz respeito à simultaneidade, a função está especificada como segura para threads (thread-safe), segura contra exceções (exception safe) e noexcept [SWS_PER_00430]. Se ocorrer um erro, o ara::core::Result fornece erros específicos do fabricante ou códigos de erro normalizados de PerErrc [SWS_PER_00430]:

  • PerErrc::kResourceBusy: O ficheiro já está aberto ou está a ser processado simultaneamente por DeleteFile, RecoverFile ou ResetFile [SWS_PER_00430].
  • PerErrc::kFileNotFound: o arquivo especificado não existe no armazenamento de arquivos [SWS_PER_00430].
  • PerErrc::kInvalidOpenMode: O modo transmitido contém uma combinação inválida de opções [SWS_PER_00430].
  • Erros de integridade e segurança: PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed ou PerErrc::kAuthenticationFailed (falha na verificação de MAC), bem como StorageFailure em caso de erros de acesso ao armazenamento físico [SWS_PER_00430].

Além desta variante com buffer, estão disponíveis para casos de utilização sem buffer definido pelo utilizador as sobrecargas [SWS_PER_00114] (com mode) e [SWS_PER_00376] (apenas com fileName).

Esta nota de uso foi gerada automaticamente com base na especificação AUTOSAR R25-11.

Guia do implementador em breve (complexidade 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#7b5d35a9
Content hash
7b5d35a9
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: cf05039b8020 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

usar

O método síncrono OpenFileReadWrite da classe ara::per::FileStorage abre um ficheiro para acessos de leitura e escrita no modo indicado mode [SWS_PER_00113]. Se não for especificado de outro modo no modo, o ponteiro do ficheiro é colocado por predefinição no início (kAtTheBeginning). Se o ficheiro ainda não existir, é criado automaticamente [SWS_PER_00113]. A função retorna um ara::core::Result com um UniqueHandle<ReadWriteAccessor>, o qual fecha o ficheiro automaticamente assim que o handle sair do seu âmbito de validade [SWS_PER_00113].

Simultaneidade e restrições

A chamada é segura para threads (thread-safe) e não lança exceções (noexcept) [SWS_PER_00113]. O ficheiro não pode estar já aberto no momento da chamada. Além disso, não pode ocorrer uma execução simultânea de DeleteFile, RecoverFile ou ResetFile com o mesmo nome de ficheiro, caso contrário a chamada falhará com PerErrc::kResourceBusy [SWS_PER_00113].

Tratamento de erros

Em caso de erro, o ara::core::Result contém códigos de erro específicos [SWS_PER_00113]:

  • PerErrc::kInvalidOpenMode: combinação inválida de flags no mode passado.
  • PerErrc::kResourceBusy: o ficheiro de destino já está aberto ou está ocupado por operações administrativas de ficheiros.
  • Access: o armazenamento está configurado como read-only ou como write-only-once com uma chave já existente.
  • PerErrc::kOutOfStorageSpace ou PerErrc::kTooManyFiles: espaço de armazenamento físico insuficiente ou ultrapassagem de maxNumberOfFiles na nova criação.
  • PerErrc::kPhysicalStorageFailure, PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed, PerErrc::kAuthenticationFailed: erros de acesso ao hardware, estruturas de dados corrompidas ou validações criptográficas com falha.

Interação

Como variante simplificada, está disponível uma sobrecarga sem parâmetro de modo, que abre ficheiros por predefinição no início [SWS_PER_00375]. Para otimização de desempenho no caso de numerosos acessos pequenos, existe ainda uma sobrecarga com buffer definido pelo utilizador (buffer) para leitura e escrita por blocos [SWS_PER_00429].

Esta nota de utilização foi gerada por uma IA com base na especificação AUTOSAR Adaptive Release R25-11.

Guia do implementador em breve (complexidade 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#6649e1d9
Content hash
6649e1d9
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: e0c7dc90877b Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

A função-membro síncrona OpenFileReadWrite da classe ara::per::FileStorage serve para abrir um ficheiro para acessos combinados de leitura e escrita [SWS_PER_00375]. É transmitido como parâmetro o nome do ficheiro fileName como ara::core::StringView, o qual pode corresponder à modelagem PersistencyFile.fileName de um ficheiro configurado [SWS_PER_00375]. Se o ficheiro especificado ainda não existir, é criado automaticamente de raiz [SWS_PER_00375]. Ao abrir, a posição do ficheiro é colocada imediatamente no início (em conformidade com kAtTheBeginning) [SWS_PER_00375]. O chamador recebe um ara::core::Result<UniqueHandle<ReadWriteAccessor>>; o ficheiro é fechado automaticamente assim que o UniqueHandle devolvido sai do seu âmbito de validade [SWS_PER_00375].

No que diz respeito à concorrência e ao contexto de execução, a função está especificada como thread-safe e exception safe [SWS_PER_00375]. Deve-se notar, contudo, que os acessos simultâneos são regulamentados: se o ficheiro já estiver aberto ou se for executada simultaneamente uma operação como DeleteFile, RecoverFile ou ResetFile com o mesmo nome de ficheiro, a chamada falha e devolve o código de erro PerErrc::kResourceBusy [SWS_PER_00375].

Em caso de erro, o objeto Result devolvido encapsula erros específicos de persistência ou erros específicos do fabricante [SWS_PER_00375]:

  • Erros de configuração e de acesso como Access no caso de armazenamento protegido contra escrita ou dados já existentes com configuração Write-Once [SWS_PER_00375].
  • Limites de espaço de armazenamento através de PerErrc::kOutOfStorageSpace ou PerErrc::kTooManyFiles em caso de excesso do limite máximo configurado para o ficheiro [SWS_PER_00375].
  • Erros de integridade e segurança como PerErrc::kPhysicalStorageFailure, PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed ou PerErrc::kAuthenticationFailed [SWS_PER_00375].

Na interação com outras interfaces de FileStorage, o AUTOSAR disponibiliza sobrecargas alternativas: OpenFileReadWrite pode ser chamada com OpenMode explícito [SWS_PER_00113] ou com uma área de memória adicional do lado do utilizador buffer (ara::core::Span<ara::core::Byte>), que possibilita um buffering por blocos para acelerar pequenos acessos repetidos [SWS_PER_00429].

Este texto foi gerado por uma IA e verificado com base na especificação AUTOSAR.

Guia do implementador em breve (complexidade 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#99c70afb
Content hash
99c70afb
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 06577277e905 Procedência Perguntas em aberto (1)
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

usar

O método OpenFileReadWrite da classe ara::per::FileStorage abre um ficheiro de forma síncrona para leitura e escrita combinadas, disponibilizando um buffer definido pelo utilizador [SWS_PER_00429]. O intervalo de memória transmitido buffer (como ara::core::Span<ara::core::Byte>) é utilizado internamente pelo ReadWriteAccessor para operações de leitura e escrita por blocos, a fim de processar de forma eficiente séries de pequenos acessos. Se o ficheiro indicado ainda não existir, é criado de novo automaticamente; a posição do ficheiro situa-se, por padrão, no início (kAtTheBeginning), exceto se especificado de outra forma no mode transmitido [SWS_PER_00429]. O ficheiro é fechado assim que o UniqueHandle retornado em ara::core::Result sai do seu âmbito. Interpretação: A memória subjacente do buffer span transmitido deve provavelmente permanecer válida durante todo o tempo de vida do UniqueHandle, uma vez que o acessor a referencia para acessos por blocos. Pergunta Q-e0009b7de17e3597 (aberta)

Tratamento de erros e simultaneidade

A função está especificada como noexcept, segura contra exceções (exception safe) e segura para threads [SWS_PER_00429]. Em caso de falha, o Result fornece erros específicos do fabricante ou códigos de erro definidos:

  • PerErrc::kResourceBusy: O ficheiro já está aberto ou está a ser processado simultaneamente com o mesmo nome por DeleteFile, RecoverFile ou ResetFile [SWS_PER_00429].
  • Access: A área de armazenamento está configurada como read-only ou definida como write-only-once e já ocupada [SWS_PER_00429].
  • PerErrc::kInvalidOpenMode: O mode transmitido contém uma combinação inválida de características [SWS_PER_00429].
  • PerErrc::kOutOfStorageSpace ou PerErrc::kTooManyFiles: O armazenamento físico não é suficiente para uma nova criação ou o limite configurado maxNumberOfFiles seria excedido [SWS_PER_00429].
  • PerErrc::kPhysicalStorageFailure, PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed e PerErrc::kAuthenticationFailed: Erros no acesso, na verificação de integridade, MAC ou validação, bem como na desencriptação [SWS_PER_00429].

Interação

O método representa uma variante com desempenho otimizado da abertura para leitura/escrita: enquanto [SWS_PER_00113] processa apenas o nome do ficheiro e o modo, e [SWS_PER_00375] processa exclusivamente o nome do ficheiro, [SWS_PER_00429] permite a aceleração orientada de pequenos acessos de E/S através de um buffer de memória explícito.

Este texto foi gerado por uma IA e baseia-se nas diretrizes da especificação AUTOSAR.

Guia do implementador em breve (complexidade 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#f3d12a93
Content hash
f3d12a93
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: cf72b60c71fb Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

usar

O método OpenFileWriteOnly da classe ara::per::FileStorage abre um ficheiro de forma síncrona para escrita exclusiva com um modo de acesso definido [SWS_PER_00115]. A menos que seja indicado em contrário através do parâmetro mode, o ficheiro é truncado (de acordo com kTruncate). Se o ficheiro ainda não existir, ele é criado. O valor de retorno é um ara::core::Result<UniqueHandle<WriteAccessor>>; ao sair do âmbito de validade do UniqueHandle, o ficheiro é automaticamente fechado de novo [SWS_PER_00115].

Tratamento de erros

Em caso de erro, o Result devolvido contém códigos de erro específicos [SWS_PER_00115]: Access indica que o armazenamento é protegido contra escrita ou foi configurado como Write-Once e a chave já existe. PerErrc::kInvalidOpenMode assinala combinações inválidas de modos e PerErrc::kOutOfStorageSpace espaço de armazenamento físico insuficiente. Além disso, podem ocorrer PerErrc::kTooManyFiles, PerErrc::kPhysicalStorageFailure, bem como erros de integridade e segurança como PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed ou PerErrc::kAuthenticationFailed [SWS_PER_00115].

Simultaneidade e restrições

A função foi concebida para ser segura para threads (thread-safe), bem como segura em termos de exceções (noexcept) [SWS_PER_00115]. Os acessos simultâneos ao mesmo ficheiro falham com o código de erro PerErrc::kResourceBusy se o ficheiro já estiver aberto ou se operações como DeleteFile, RecoverFile ou ResetFile forem executadas em paralelo com o mesmo nome de ficheiro [SWS_PER_00115].

Interação

Além desta função, a interface disponibiliza uma sobrecarga simplificada sem parâmetro de modo, que funciona por predefinição com kTruncate [SWS_PER_00377], bem como uma sobrecarga com um buffer personalizado para permitir a escrita por blocos para acelerar muitos acessos pequenos [SWS_PER_00431].

Esta nota de uso foi gerada por uma IA com base na especificação.

Guia do implementador em breve (complexidade 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#9ad075d6
Content hash
9ad075d6
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: fa6d3b80cd05 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

usar

O método síncrono OpenFileWriteOnly da classe ara::per::FileStorage abre um ficheiro exclusivamente para escrita de acordo com [SWS_PER_00377]. Recebe o nome do ficheiro de destino através do parâmetro fileName. Se o ficheiro não existir, é criado de novo; um ficheiro já existente é truncado (de acordo com kTruncate) [SWS_PER_00377]. Como valor de retorno serve um ara::core::Result, que encapsula um ara::per::UniqueHandle<WriteAccessor> em caso de sucesso. Este identificador fecha o ficheiro automaticamente segundo o padrão RAII assim que sai do âmbito [SWS_PER_00377].

Tratamento de erros e simultaneidade

A operação é declarada como noexcept, segura contra exceções e segura para threads [SWS_PER_00377]. Em caso de erro, o Result contém um código de erro específico de PerErrc ou um erro específico do fabricante [SWS_PER_00377]:

  • PerErrc::kResourceBusy: O ficheiro já está aberto ou está a ser trabalhado em simultâneo por DeleteFile, RecoverFile ou ResetFile.
  • PerErrc::kOutOfStorageSpace e PerErrc::kTooManyFiles: A memória física não é suficiente ou o número máximo de ficheiros configurados (maxNumberOfFiles) é excedido.
  • PerErrc::kPhysicalStorageFailure, PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed ou PerErrc::kAuthenticationFailed: Erro no acesso ao hardware, bem como em verificações de integridade, validação ou desencriptação.

Interação

Enquanto esta variante define o truncamento de forma fixa, a sobrecarga com o parâmetro OpenMode permite um modo de abertura diferente [SWS_PER_00115]. Para operações de escrita otimizadas por blocos com vários acessos pequenos, está disponível outra sobrecarga com buffer definido pelo utilizador (ara::core::Span<ara::core::Byte>) [SWS_PER_00431].

Este texto foi gerado por uma IA com base na especificação AUTOSAR Adaptive R25-11.

Guia do implementador em breve (complexidade 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#6b46e720
Content hash
6b46e720
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 37dc6b2848d7 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

O método síncrono OpenFileWriteOnly da classe ara::per::FileStorage abre um ficheiro exclusivamente para escrita e devolve um ara::core::Result<UniqueHandle<WriteAccessor>> em caso de sucesso [SWS_PER_00431]. Ao sair do âmbito do UniqueHandle devolvido, o ficheiro aberto é automaticamente fechado [SWS_PER_00431]. Além do nome do ficheiro fileName e do modo de acesso mode, a chamada recebe um buffer do lado do utilizador buffer (como ara::core::Span<ara::core::Byte>), que é utilizado para escrita por blocos a fim de acelerar pequenos acessos de escrita repetidos [SWS_PER_00431]. Salvo configuração diferente no modo, o ficheiro é truncado aquando da abertura (de acordo com kTruncate); se ainda não existir, é criado de novo [SWS_PER_00431].

No que diz respeito à simultaneidade e à segurança, o método está especificado como thread-safe e exception safe, bem como declarado como noexcept [SWS_PER_00431]. Contudo, o acesso falha se o ficheiro já estiver aberto ou se operações de gestão como DeleteFile, RecoverFile ou ResetFile estiverem a ser executadas simultaneamente sobre o mesmo nome de ficheiro [SWS_PER_00431].

Em caso de erro, é devolvido no resultado um código de erro correspondente de PerErrc ou um erro específico do fabricante [SWS_PER_00431]:

  • PerErrc::kResourceBusy: O ficheiro já está aberto ou está ocupado por outra operação de ficheiro [SWS_PER_00431].
  • PerErrc::kIllegalWriteAccess: O File Storage está protegido contra escrita ou configurado como write-only-once e o ficheiro já existe [SWS_PER_00431].
  • PerErrc::kInvalidOpenMode: A combinação de modos transmitida é inválida [SWS_PER_00431].
  • PerErrc::kOutOfStorageSpace ou PerErrc::kTooManyFiles: O espaço de armazenamento não é suficiente ou o número máximo de ficheiros configurados é excedido [SWS_PER_00431].
  • PerErrc::kPhysicalStorageFailure, PerErrc::kIntegrityCorrupted, PerErrc::kValidationFailed, PerErrc::kEncryptionFailed ou PerErrc::kAuthenticationFailed: Falha no acesso físico, na integridade, na validação, na desencriptação ou na autenticação [SWS_PER_00431].

Na interação com outras interfaces, a função expande os métodos base [SWS_PER_00377] (apenas fileName) e [SWS_PER_00115] (com mode) especificamente com suporte a buffer para operações de escrita otimizadas [SWS_PER_00431].

Esta nota de utilização foi gerada automaticamente com base na especificação da AUTOSAR R25-11.

Guia do implementador em breve (complexidade 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#14ccb982
Content hash
14ccb982
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 1adb8f07ad8e Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

usar

O método síncrono RecoverFile da classe ara::per::FileStorage executa uma restauração de melhor esforço de um único ficheiro se as verificações de redundância falharem [SWS_PER_00337]. O identificador do ficheiro afetado é transmitido através do parâmetro fileName como ara::core::StringView. Após a restauração, o ficheiro pode apresentar estados desatualizados ou o conteúdo inicial, ou, no pior dos casos, ser perdido [SWS_PER_00337].

Concorrência e interação

A operação está especificada como segura para threads e segura contra exceções [SWS_PER_00337]. No entanto, não pode ser executada em ficheiros abertos: antes da chamada, todas as instâncias de UniqueHandle obtidas anteriormente através de métodos de abertura de ficheiros como [SWS_PER_00113], [SWS_PER_00114] ou [SWS_PER_00375] têm de estar fechadas [SWS_PER_00337]. Caso contrário, a chamada falha com PerErrc::kResourceBusy. O mesmo erro é reportado se [SWS_PER_00111] (DeleteFile) ou [SWS_PER_00338] (ResetFile) estiver a ser executado simultaneamente para o mesmo nome de ficheiro [SWS_PER_00337].

Tratamento de erros

A função retorna um ara::core::Result<void> [SWS_PER_00337]. Além de PerErrc::kResourceBusy, podem ocorrer os seguintes erros normalizados:

  • PerErrc::kFileNotFound: o arquivo especificado não existe no armazenamento de arquivos [SWS_PER_00337].
  • PerErrc::kPhysicalStorageFailure: O acesso ao suporte de armazenamento físico falha [SWS_PER_00337].
  • PerErrc::kOutOfStorageSpace: O espaço de armazenamento físico disponível não é suficiente para o ficheiro restaurado [SWS_PER_00337].
  • PerErrc::kQuotaExceeded: O ficheiro restaurado excederia o limite configurado maximumAllowedSize [SWS_PER_00337].
  • PerErrc::kEncryptionFailed e PerErrc::kAuthenticationFailed: A desencriptação criptográfica ou a validação de MAC dos dados armazenados falhou [SWS_PER_00337].

Esta nota de uso foi gerada automaticamente com base na especificação AUTOSAR R25-11.

Guia do implementador em breve (complexidade 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#2dd8585a
Content hash
2dd8585a
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

função 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.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 16bebc8c99d8 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

O método síncrono ResetFile da classe ara::per::FileStorage repõe um único ficheiro no seu estado inicial pré-configurado [SWS_PER_00338]. Se o ficheiro especificado através de fileName ainda não existir no armazenamento, é criado de novo [SWS_PER_00338]. Em ambos os casos, o ficheiro passa a ter o mesmo conteúdo que após uma nova instalação a partir da Target Configuration atual [SWS_PER_00338]; o seu estado de modificação é mantido em FileModificationState como kModifiedDuringReset [SWS_PER_00436].

A operação é segura para threads bem como segura contra exceções e devolve sincronamente um ara::core::Result<void> [SWS_PER_00338]. Falha com PerErrc::kResourceBusy se o ficheiro estiver atualmente aberto – por exemplo, através de [SWS_PER_00113] – ou se ocorrer em simultâneo uma execução de [SWS_PER_00111] ou [SWS_PER_00337] com o mesmo nome de ficheiro [SWS_PER_00338].

Adicionalmente, a interface define casos de erro específicos [SWS_PER_00338]:

  • PerErrc::kInitValueNotAvailable: Não está configurado nenhum valor inicial nem no Application Design nem na Target Configuration [SWS_PER_00338].
  • PerErrc::kQuotaExceeded ou PerErrc::kTooManyFiles: O ficheiro restaurado excederia o limite AllowedSize ou maxNumberOfFiles [SWS_PER_00338].
  • PerErrc::kOutOfStorageSpace ou StorageFailure: O espaço de armazenamento físico não é suficiente ou o acesso físico falha [SWS_PER_00338].
  • PerErrc::kEncryptionFailed ou PerErrc::kAuthenticationFailed: A encriptação/desencriptação ou a verificação de MAC dos dados armazenados falha [SWS_PER_00338].

Esta nota de utilização foi criada por uma IA e baseia-se na especificação AUTOSAR Adaptive R25-11.

Guia do implementador em breve (complexidade 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#481a6152
Content hash
481a6152
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

função 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#829957af
Content hash
829957af
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

função 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#b935e6cf
Content hash
b935e6cf
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

função ~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#41b93183
Content hash
41b93183
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