sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Mac Help Needed

    Scheduled Pinned Locked Moved Developers' Forum
    10 Posts 3 Posters 293 Views 3 Watching
    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.
    • M Offline
      MartinRinehart
      last edited by

      I'm trying to write a bit of code that let's the developer access WebDialog's HTML files in locations of your own choice. I need to know what happens as you back up toward and at your root directory.

      If someone could try this:

      In the Ruby Console ask Dir::pwd (*nix for Print Working Directory). That should report something like /foo/bar/moo/baz. Then back up a directory with Dir::chdir( '..' ) and ask Dir::pwd again. (You can use the up arrow in the RC to save retyping.)

      It should report /foo/bar/moo. Done again you should get /foo/bar then /foo, then / and then? Do you get an error or do you just get / again? Or do you get an error before you get this far?

      Thanks ever so much!

      Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

      1 Reply Last reply Reply Quote 0
      • T Offline
        tfdesign
        last edited by

        Hi Martin, completely out of my depth here, but I am interested in code...

        all i get after typing

        Dir::pwd

        is;

        /

        That's it!

        My book "Let's SketchUp!" Download from here

        1 Reply Last reply Reply Quote 0
        • T Offline
          tfdesign
          last edited by

          do I get a stroke, because the root directory is disabled by default on a Mac?

          http://support.apple.com/kb/HT1528

          My book "Let's SketchUp!" Download from here

          1 Reply Last reply Reply Quote 0
          • M Offline
            MartinRinehart
            last edited by

            @tfdesign said:

            all i get after typing

            Dir::pwd

            is;

            /

            That's it!

            And if you then Dir::chmod( '..' ) and then Dir::pwd do you still look at the single forward slash (root)?

            Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

            1 Reply Last reply Reply Quote 0
            • T Offline
              tfdesign
              last edited by

              Martin, yes.

              > Dir;;chmod( '..' )
              Error; #<NoMethodError; undefined method `chmod' for Dir;Class>
              (eval);16
              > Dir;;pwd
              /
              
              

              My book "Let's SketchUp!" Download from here

              1 Reply Last reply Reply Quote 0
              • M Offline
                MartinRinehart
                last edited by

                @tfdesign said:

                Martin, yes.

                > Dir;;chmod( '..' )
                > Error; #<NoMethodError; undefined method `chmod' for Dir;Class>
                > (eval);16
                > > Dir;;pwd
                > /
                > 
                

                Stupid me. That should be Dir::chdir( '..' ). Glad you showed the error message.

                Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                1 Reply Last reply Reply Quote 0
                • T Offline
                  tfdesign
                  last edited by

                  Martin,

                  I tried that, and the ruby console returned;

                  0

                  Nought. (or zero) πŸ˜„

                  My book "Let's SketchUp!" Download from here

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    todd burch
                    last edited by

                    The default working directory for Ruby inside Sketchup is root.

                    You could start with ENV['HOME'] to get to a more reasonable choice for user files.

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      MartinRinehart
                      last edited by

                      Thanks, guys.

                      I've looked harder and seen that there is NO Mac issue. It's a Windows-only problem.

                      http://forums.sketchucation.com/viewtopic.php?f=180&t=26040&p=224362#p224362

                      I'll post my little movie later today and it just might run on Macs. (Crossing fingers, knocking wood, rubbing rabbit's foot.)

                      Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        tfdesign
                        last edited by

                        @martinrinehart said:

                        I've looked harder and seen that there is NO Mac issue. It's a Windows-only problem.

                        That's heartening to hear! The amount of times I've heard windows developers moan that there is a fault, and it is Apple's fault! πŸ˜†

                        My book "Let's SketchUp!" Download from here

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        Buy SketchPlus
                        Buy SUbD
                        Buy WrapR
                        Buy eBook
                        Buy Modelur
                        Buy Vertex Tools
                        Buy SketchCuisine
                        Buy FormFonts

                        Advertisement