header_file_matches | R Documentation |
FileFormat
instance.
Will test for match to header file onlyValidates whether a file name conforms to the header file format specification.
header_file_matches(x, file_name)
## S4 method for signature 'FileFormat,character'
header_file_matches(x, file_name)
x |
A FileFormat object specifying the format requirements |
file_name |
A character string specifying the file name to validate |
The function performs case-sensitive pattern matching to verify that the file name ends with the specified header extension. The match is performed using a regular expression that ensures the extension appears at the end of the file name.
TRUE for match, FALSE otherwise
A logical value: TRUE
if the file name matches the header format,
FALSE
otherwise
file_matches
, data_file_matches
for related
file format validation
## Not run:
fmt <- new("FileFormat", header_extension = "hdr", data_extension = "img")
header_file_matches(fmt, "brain_scan.hdr") # TRUE
header_file_matches(fmt, "brain_scan.img") # FALSE
header_file_matches(fmt, "brain.hdr.gz") # FALSE
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.