Writing to a file functions



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/07/2007 at 15:47, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   10.111 
    Platform:   Windows  ;   
    Language(s) :   C.O.F.F.E.E  ;

    ---------
    I was trying to use the WriteString functions but they kept giving errors so I decided to use the default.

    After copy-pasting the code from the SDK into the script manager, it fails to write the string. The RemoveLast() and WriteString() functions fail, but the Open(), Add(), and new() functions work.

    Is this a bug or is there something I'm missing?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 20/07/2007 at 01:02, xxxxxxxx wrote:

    Hmm, afaik in the script manager just like in an expression file access is actually forbidden. So to my knowledge it won´t work by intention. See the COFFEE docs for information on this.

    Anyway, maybe for the scriptmanager it changed..this I don´t know.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 20/07/2007 at 01:27, xxxxxxxx wrote:

    File access is only possible through the Script manager. It all seems to work fine here. Can you post an example of not working code please?

    cheers,
    Matthias



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 20/07/2007 at 02:45, xxxxxxxx wrote:

    There you go :)



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 20/07/2007 at 09:12, xxxxxxxx wrote:

    Well here's the code that I tried, which is the one in the SDK documentation:
    -------------------------------------------------
    // Creates a filename that points to "foo.txt"
    //in the plugin's directory
    var filename = GeGetRootFilename();
    var test = filename->RemoveLast();
    println("remove:",test);
    var test3 = filename->Add("foo.txt");
    println("add:",test3);

    // Creates the file and writes a string to it
    var file = new(BaseFile);
    println("basefile:",file);
    var test4 = file->Open(filename, GE_WRITE);
    println("open:",test4);
    var test2 = file->WriteString("Hello World!");
    println("write:",test2);
    -------------------------------------

    The Remove() and WriteString() functions return false but the other 3 (add,new(basefile),open) succeed.


Log in to reply