-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RenameItem doesn't seem to work #116
Comments
Bug isn't with OpenMCDF. |
This should work. CompoundFile cf = new CompoundFile();
cf.RootStorage.AddStorage("AStorage")
.AddStream("AStream")
.SetData(Helpers.GetBuffer(100));
cf.SaveAs("Hello$File");
cf.Close();
CompoundFile cf1 = new CompoundFile("Hello$File", CFSUpdateMode.Update, CFSConfiguration.Default);
try
{
cf1.RootStorage.RenameItem("AStorage", "NewStorage");
cf1.Commit();
cf1.Close();
}
catch (Exception ex)
{
Assert.Fail(ex.Message);
} Kind Regards, |
Thank you!!
…On Tue, Feb 27, 2024, 3:30 PM Federico Blaseotto ***@***.***> wrote:
This should work.
You can change a storage from its parent storage.
CompoundFile cf = new CompoundFile();
cf.RootStorage.AddStorage("AStorage")
.AddStream("AStream")
.SetData(Helpers.GetBuffer(100));
cf.SaveAs("Hello$File");
cf.Close();
CompoundFile cf1 = new CompoundFile("Hello$File", CFSUpdateMode.Update, CFSConfiguration.Default);try{
cf1.RootStorage.RenameItem("AStorage", "NewStorage");
cf1.Commit();
cf1.Close();}catch (Exception ex){
Assert.Fail(ex.Message);}
Kind Regards,
Federico
—
Reply to this email directly, view it on GitHub
<#116 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BGPIWSXROIJBCC4R74P2NXDYVZM7VAVCNFSM6AAAAABD27O2PGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRXG43TANJSGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm attempting to rename a CFStorage within a CFStorage. The root CFStorage is called "Relays". Within Relays is one CFStorage that I'm attempting to rename.
I pass in the Compound File as an array of bytes to ReadFileBytes, then call the RenameSettingFileEntry, then call GetRDBFileData() and write the byte array to a file. The "RenameItem" function runs without error but doesn't rename the CFStorage. Thanks for your help!
The text was updated successfully, but these errors were encountered: