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 files to disk

    SDK Help
    0
    8
    663
    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
      Helper
      last edited by

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

      On 25/02/2004 at 16:01, xxxxxxxx wrote:

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

      ---------
      Hello! Could someone tell me why this fails? I named this code snippet, "test.cof" and put it in a folder called "test" in the c4d plugin folder.

        
      main()  
      {  
           var path = GeGetStartupPath();  
           path->RemoveLast();       
           path->AddLast("test.txt");  
             
        
           if (GeFileExist(path,FALSE))  
                {  
                     var filename = GeGetRootFilename();  
                     filename->RemoveLast();  
                     filename->Add("text.txt");  
                       
                     var testFile = new(BaseFile);  
                     testFile->Open(filename, GE_WRITE);  
                     testFile->WriteString("Hello World!");       
                }       
             
      }  
      

      The file does not get written, and the console displays no errors

      Thanks

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

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

        On 25/02/2004 at 18:34, xxxxxxxx wrote:

        Does the file "test.txt" exist?

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

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

          On 26/02/2004 at 00:07, xxxxxxxx wrote:

          No, I thought one could write directly to disk. Thats why I first tested if the file existed with

          if (GeFileExist(path,FALSE))
          

          Is this not possible?

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

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

            On 26/02/2004 at 02:25, xxxxxxxx wrote:

            This must definately be some kind of bug, I keep getting "unable to write file....(file may be write protected)" errors. The file does not exist on disk!!? A paradox. If I create the file manually, the code behaves as it supposed to do.

            Thanks

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

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

              On 26/02/2004 at 04:41, xxxxxxxx wrote:

              nevermind, the Maxon docs were wrong again, I tried "AddLast" by coincidence and that worked. Why o why wont maxon update the docs and COFFEE? This is sometimes very annoying.

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

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

                On 26/02/2004 at 14:58, xxxxxxxx wrote:

                Actually I couldn't find Filename::Add() in the C.O.F.F.E.E. docs. It's strange that this didn't cause a runtime error, though. I guess there must be a Filename::Add() somewhere... (Probably it's the same as the C++ "operator+(const Filename&, const Filename&)".)
                When debugging Filename related issues I often find it useful to look at the GetFullString() output.

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

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

                  On 26/02/2004 at 15:22, xxxxxxxx wrote:

                  yes, there is a Filename::Add(). It´s not documented in the Filename class but is displayed in the Example code in the docs. I guess that´s why he used it in the first place.

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

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

                    On 26/02/2004 at 15:23, xxxxxxxx wrote:

                    Hi Mikael, the use off add is in at least two examples in the downloadable windows CHM files. I would take your advice and use the GetFullString for debugging, I used a TextDialog instead, this lead to my discovery that the "add" was not nor working.

                    n

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