I can't reproduce the behavior of this working:
ImportExport`RegisterExport["ABC",...];
ImportExport`RegisterImport["ABC",...];
FileFormatDump`$FILEFORMATMATRIX["ABC"]={"ABC",...};
I tried this to be specific:
In[10]:= ImportString["", "Text"]; StringFormat[""];
myFormatImport[filename_String, opts : OptionsPattern[]] :=
StringDelete[Import[filename, "String"], "myFormat!\n"];
ImportExport`RegisterImport["myFmt", myFormatImport];
myFormatExport[filename_String, expr_, opts : OptionsPattern[]] :=
Export[filename, "myFormat!\n" <> expr, "String"];
ImportExport`RegisterExport["myFmt", myFormatExport];
FileFormatDump`$FILEFORMATMATRIX["myFmt"] = {"myFmt", True, False,
False, False, False, {"*.myext"}, {}, None, {}};
Export["test.myext", "foo"]
FileFormat["test.myext"]
Import["test.myext"]
During evaluation of In[10]:= Export::infer: Cannot infer format of file test.myext.
Out[16]= $Failed
Out[17]= "Table"
Out[18]= {{"myFormat!"}, {"foo"}}
This didn't work in either 12.0 or 11.3 whether or not the kernel was initialized. To get more to the point, these are undocumented internal symbols you are attempting to modify. There is no guarantee the behavior would or should work, nor that if it works in one version it will continue working in the next. These are not the only modifications necessary, and how to add a format's extension to the system is not obvious by spelunking. I will be submitting a function to WFR as soon as I am able which will correctly add extensions to WL for custom formats. I will post here when this is complete.
In the meantime, here is a complete example that works. I highly recommend switching to the new WFR function once it is approved, since it will cover more cases and remain maintained.
In[19]:= Quit
In[1]:= ImportString["", "Text"]; StringFormat[""];
myFormatImport[filename_String, opts : OptionsPattern[]] :=
StringDelete[Import[filename, "String"], "myFormat!\n"];
ImportExport`RegisterImport["myFmt", myFormatImport];
myFormatExport[filename_String, expr_, opts : OptionsPattern[]] :=
Export[filename, "myFormat!\n" <> expr, "String"];
ImportExport`RegisterExport["myFmt", myFormatExport];
AppendTo[System`ConvertersDump`ExtensionMappings,
"*.myext" -> "myFmt"];
FileFormatDump`$FILEFORMATS =
Insert[FileFormatDump`$FILEFORMATS, "myFmt", -2];
FileFormatDump`$FILEFORMATMATRIX["myFmt"] = {"myFmt", True, False,
False, False, False, {"*.myext"}, {}, None, {}};
Export["test.myext", "foo"]
FileFormat["test.myext"]
Import["test.myext"]
Out[9]= "test.myext"
Out[10]= "myFmt"
Out[11]= "foo"