EldoS | Feel safer!

Software components for data protection, secure storage and transfer

issue with SolFSStream mode "w"

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#28661
Posted: 03/04/2014 01:50:17
by Jeremy Spiegel (Standard support level)
Joined: 01/29/2014
Posts: 16

According to the documentation, creating a SolFSStream with mode "w" should succeed if the file already exists and just empty the file's existing contents: "Write mode. Creates new empty file for output. If a file with the same name already exists, its contents are discarded."

However, I'm seeing the library return an error when trying to open a SolFSStream with mode "w" on a file that already exists, rather open the file as new. My code is:
Code
        SolFSStorage storage;
        storage.set_FileName("/tmp/solfs_test");
        storage.Open(somCreateAlways);
        
        SolFSStream(&storage, "/file", "w").Write("abcd", 4);
        SolFSStream(&storage, "/file", "w").Write("efgh", 4);


The above throws error -5 "File or directory already exists". Thanks.

Reply

Statistics

Topic viewed 1349 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!