Ask a Question related to Macromedia Director 3D, Design and Development.

  1. #1

    Default Relative path

    Hi,

    I wrote some scripts using File::Find's find function like this

    find (\&process, $path)

    I get $path either from the command line or from a default string. Now how can I enable my scripts to deal with relative pathnames? Right now, the script complains not being able to process (open etc.) the files if I do not specify an absolute path.

    Is there a simple way to convert relative paths to absolute ones?

    Thanks,

    Jan
    --
    There are 10 kinds of people: those who understand binary, and those who don't
    Jan Eden Guest

  2. Similar Questions and Discussions

    1. Contribute 3.1 absolute/relative path bug?
      When placing images, C3 insists on saving the src attribute as relative to the document regardless of the File Placement settings specified under...
    2. User control + relative path
      Hi. I need some help on this. I have a user control (a header) in my root directory, and all my pages use that control. Then a created a folder (in...
    3. Relative Path for Shared Movies
      Is it possible to used shared assets without specifying a URL but a relative path to the shared swf file? I am currently specifying...
    4. #25506 [Opn->WFx]: <xsl:include> with relative path
      ID: 25506 Updated by: rrichards@php.net Reported By: cryo28 at rbcmail dot ru -Status: Open +Status: ...
    5. #25506 [NEW]: <xsl:include> with relative path
      From: cryo28 at rbcmail dot ru Operating system: Win2K PHP version: 4.3.3 PHP Bug Type: DOM XML related Bug description: ...
  3. #2

    Default Re: Relative path

    On Jan 19, 2004, at 6:31 AM, Jan Eden wrote:
    > Hi,
    >
    > I wrote some scripts using File::Find's find function like this
    >
    > find (\&process, $path)
    >
    > I get $path either from the command line or from a default string. Now
    > how can I enable my scripts to deal with relative pathnames? Right
    > now, the script complains not being able to process (open etc.) the
    > files if I do not specify an absolute path.
    >
    > Is there a simple way to convert relative paths to absolute ones?
    Sure is:

    use File::Spec;
    my $abs_path = File::Spec->rel2abs( $rel_path );

    Hope that helps.

    James

    James Edward Gray II Guest

  4. #3

    Default Re: Relative path


    James Edward Gray II wrote:
    >On Jan 19, 2004, at 6:31 AM, Jan Eden wrote:
    >
    >>Hi,
    >>
    >>I wrote some scripts using File::Find's find function like this
    >>
    >>find (\&process, $path)
    >>
    >>I get $path either from the command line or from a default string.
    >>Now how can I enable my scripts to deal with relative pathnames?
    >>Right now, the script complains not being able to process (open
    >>etc.) the files if I do not specify an absolute path.
    >>
    >>Is there a simple way to convert relative paths to absolute ones?
    >
    >Sure is:
    >
    >use File::Spec; my $abs_path = File::Spec->rel2abs( $rel_path );
    >
    >Hope that helps.
    It certainly does. Thanks! I always hesitate to use perldoc, since the system is so crippled on my machine.

    'perldoc perldoc' does not work, and the whole perlfaq is missing (on OS 10.3).

    Unfortunately, rel2abs and abs2rel are not mentioned in either Perl in a Nutshell or Programming Perl.

    Thanks again,

    Jan
    --
    How many Microsoft engineers does it take to screw in a lightbulb? None. They just redefine "dark" as the new standard.
    Jan Eden Guest

  5. #4

    Default Re: Relative path

    On Jan 19, 2004, at 9:53 AM, Jan Eden wrote:
    > I always hesitate to use perldoc, since the system is so crippled on
    > my machine.
    >
    > 'perldoc perldoc' does not work, and the whole perlfaq is missing (on
    > OS 10.3).
    You probably know this, but just to be sure, this is not normal.
    'perldoc' works beautifully on OS X (all versions) out of the box.

    I imagine you could fix it by upgrading/reinstalling Perl, if you're
    interested.

    Alternately, try:

    [url]http://www.perldoc.com/[/url]

    James

    James Edward Gray II Guest

  6. #5

    Default Re: Relative path


    James Edward Gray II wrote:
    >On Jan 19, 2004, at 9:53 AM, Jan Eden wrote:
    >
    >> I always hesitate to use perldoc, since the system is so crippled on
    >> my machine.
    >>
    >> 'perldoc perldoc' does not work, and the whole perlfaq is missing (on
    >> OS 10.3).
    >
    >You probably know this, but just to be sure, this is not normal.
    >'perldoc' works beautifully on OS X (all versions) out of the box.
    >
    That's what I suspected and what I heard.
    >I imagine you could fix it by upgrading/reinstalling Perl, if you're
    >interested.
    >
    Can I reinstall Perl (just Perl) from the OS X CDs?
    >Alternately, try:
    >
    >[url]http://www.perldoc.com/[/url]
    >
    This will help for now. Thank you.

    - Jan
    --
    The day Microsoft makes something that doesn't suck is the day they start selling vacuum cleaners.
    Jan Eden Guest

  7. #6

    Default Re: Relative path

    On Jan 19, 2004, at 10:50 AM, Jan Eden wrote:
    >> I imagine you could fix it by upgrading/reinstalling Perl, if you're
    >> interested.
    >>
    > Can I reinstall Perl (just Perl) from the OS X CDs?
    Unfortunately, I don't believe you can. Sorry.

    James

    James Edward Gray II Guest

  8. #7

    Default Re: Relative path

    --As off Monday, January 19, 2004 5:50 PM +0100, Jan Eden is alleged
    to have said:
    >> I imagine you could fix it by upgrading/reinstalling Perl, if
    >> you're interested.
    >>
    > Can I reinstall Perl (just Perl) from the OS X CDs?
    --As for the rest, it is mine.

    Yes, if you get the program Pacifist. It can extract partial
    installs out of the general installers.

    But I'd try a permissions repair first; it often fixes this sort of
    thing.

    One other thing, perldoc is actually a part of the Developer Tools
    (eg, XCode) install, not the normal OS X install. If you haven't
    installed that then that could be the problem. (Perl itself is part
    of the base system, but you only need the docs if you are a
    developer.)

    Daniel T. Staal

    ---------------------------------------------------------------
    This email copyright the author. Unless otherwise noted, you
    are expressly allowed to retransmit, quote, or otherwise use
    the contents for non-commercial purposes. This copyright will
    expire 5 years after the author's death, or in 30 years,
    whichever is longer, unless such a period is in excess of
    local copyright law.
    ---------------------------------------------------------------
    Daniel Staal Guest

  9. #8

    Default Re: Relative path


    Daniel Staal wrote:
    >One other thing, perldoc is actually a part of the Developer Tools
    >(eg, XCode) install, not the normal OS X install. If you haven't
    >installed that then that could be the problem. (Perl itself is part
    >of the base system, but you only need the docs if you are a
    >developer.)
    >
    Ha! I turned off my computer for two hours and thought about it. Then I remembered installing the devtools but omitting the giant developer tools documentation. I guess that's my problem. Will install the docs tomorrow morning and see if it works.

    Thanks Daniel and James for your help.

    - Jan
    --
    Either this man is dead or my watch has stopped. - Groucho Marx
    Jan Eden Guest

  10. #9

    Default relative path

    Hi there!

    Is it possible to make relative path on images import with " Link to
    external file " option???

    Any tips or any links??

    ps: I'm a poor little beginner in 3D lingo scripting.



    frank Guest

  11. #10

    Default Re: relative path

    I'm not quite certain I've read your question correctly, but you may be
    looking for this:
    the moviepath
    or
    the applicationpath
    or even
    importfileinto

    "frank" <fjunquas@svenson.gp> wrote in message
    news:buh6kr$emd$2@forums.macromedia.com...
    > Hi there!
    >
    > Is it possible to make relative path on images import with " Link to
    > external file " option???
    >
    > Any tips or any links??
    >
    > ps: I'm a poor little beginner in 3D lingo scripting.
    >
    >
    >

    paul Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139