CTB and Temporary file location

Home Forums cherrytree CTB and Temporary file location

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  acry 6 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #125147

    JackR1
    Member

    Hello,

    I am reading Cherrytree file format and wondering if anyone can help me to understand this as it is rather confusing.

    1) The documentation say it uses 7-ZIP and “Both file types are compressed and password-protected with 7zip.” “Both file types” only means CTX and CTZ are compressed with the password. Is that correct?

    2) Does the program use -p -mhe encryption in 7z?

    3) When one loads a CTX and CTZ, the protected archive, cherrytree decrypts the encrypted archive to the temporary directory to operate and in the even of program crashes, abrupt termination, or machine crash, the unprotected data is left in the temporary directory.

    During the usage of the archive (in unencrypted form) can other program access it, even in read-only mode or does Cherrytree ensure single user using it?

    Question is: Is there a way to nominate where the temporary directory to Cherrytree?

    4) When using CTB or CTD, does Cherrytree creates other files (temporary or otherwise)?

    Thanks.

    Jack

    #125151

    acry
    Member

    from cons.py:
    TMP_FOLDER = tempfile.mkdtemp()

    Creates a temporary directory in the most secure manner possible. There are no race conditions in the directory’s creation. The directory is readable, writable, and searchable only by the creating user ID.

    The user of mkdtemp() is responsible for deleting the temporary directory and its contents when done with it.

    The prefix, suffix, and dir arguments are the same as for mkstemp().

    mkdtemp() returns the absolute pathname of the new directory.

    from:
    https://docs.python.org/2/library/tempfile.html

    from support.py:

    CT saves the document in an encrypted 7zip archive. When viewing or editing the document, CT extracts the encrypted archive to a temporary folder, and works on the unencrypted copy. When closing, the unencrypted copy is deleted from the temporary directory. Note that in the case of application or system crash, the unencrypted document will remain in the temporary folder.

    in core.py:

    def file_write_low_level
    bash_str = '%s a -p%s -w%s -mx1 -bd -y %s %s'
    def file_get_cherrytree_data
    bash_str = '%s e -p%s -w%s -bd -y -o%s %s'

    uncomment the debug statement in both methods and run CT from shell to see the output.
    #print bash_str

    Hope this helps,

    –Cass

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.