Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Writing to a file functions

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 380 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            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 🙂

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post