Mac Help Needed
-
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 withDir::chdir( '..' )and askDir::pwdagain. (You can use the up arrow in the RC to save retyping.)It should report
/foo/bar/moo. Done again you should get/foo/barthen/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!
-
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!
-
do I get a stroke, because the root directory is disabled by default on a Mac?
-
@tfdesign said:
all i get after typing
Dir::pwd
is;
/
That's it!
And if you then
Dir::chmod( '..' )and thenDir::pwddo you still look at the single forward slash (root)? -
Martin, yes.
> Dir;;chmod( '..' ) Error; #<NoMethodError; undefined method `chmod' for Dir;Class> (eval);16 > Dir;;pwd / -
@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. -
Martin,
I tried that, and the ruby console returned;
0
Nought. (or zero)

-
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.
-
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.)
-
@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!

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement