www.webdeveloper.com
Results 1 to 3 of 3

Thread: directory paths using single slash

  1. #1
    Join Date
    Feb 2007
    Location
    New York, NY
    Posts
    27

    directory paths using single slash

    In straight HTML, if you want to go up one level from a sub-folder, you use 2 dots slash ../doc.html. Get confused when seeing 1 dot slash ./doc.html or no dot slash /doc.html (as shown below). Does ths have to do with .ASP or .PHP?

    Can you define/explain such usage?

    Code:
    <link rel="icon" href="/images/display/buttons/favicon.ico" type="image/x-icon" /> 
    <link rel="shortcut icon" href="/images/display/buttons/favicon.ico" type="image/x-icon" /> 
    <link type="text/css" href="/styles.css" rel="StyleSheet" />
    <link type="text/css" href="/lightbox.css" rel="StyleSheet" />
    <!--[if lt IE 7]>
        <script type="text/javascript" src="/dssleight.js"></script> <![endif]-->
    <script type="text/javascript" src="/wom.js"></script>
    <script type="text/javascript" src="/print.js"></script>
    <script type="text/javascript" src="/4218.js"></script>
            <form name="searchForm" id="searchForm" action="/search.asp" method="get">
     ...
                <a href="javascript:document.searchForm.submit();"><img src="/images/display/buttons/search.gif" alt="Search" class="searchButton"></a>
                . . .
                . . .
    <img src="/images/display/skylines/skylineBlue.jpg" alt="Fashion Institue of Technology Skyline" class="siteBanner" id="siteBanner"></div>
        <a href="/index.asp"><img src="/images/display/general/logo.gif" alt="logo" class="siteLogo"></a>
    When doing "stand alone" test (in same folder), <link type="text/css" href="/styles.css" rel="StyleSheet" /> did not work, but href="styles.css" did.

  2. #2
    Join Date
    Aug 2006
    Posts
    1,917
    Here's a general description of all the varieties, you can look at the Unix ones as they are relevant for the web. They also work on Windows servers, so really it's the only flavor you need to learn here.

    The single dot "./file" syntax has always been a bit odd, as it is identical to just "file", which is the more common usage. I've never found a reason to use the single dot syntax.

    Dave

  3. #3
    Join Date
    Feb 2007
    Location
    New York, NY
    Posts
    27

    Whewh!

    Thanks tracknut. All that at http://en.wikipedia.org/wiki/Path_%28computing%29 overwhelmed me

    I'm thinking this has to do with "command line" programming??? Going to try to absorb the following part

    Unix style
    The following worked example discusses the behavior of a Unix-style file system as it would appear from a terminal or terminal application (command-line window):

    Attached to a current working directory (cwd) of: /users/mark/

    One wants to change the current working directory to:
    /users/mark/bobapples

    At that moment, the relative path for the desired directory can be represented as: ./bobapples
    or for short: bobapples

    and the absolute path for the directory as:
    /users/mark/bobapples

    Given bobapples as the relative path for the directory wanted, the following may be typed at the command prompt to change the current working directory to bobapples: cd bobapples

    Two dots ("..") point upwards in the hierarchy, to indicate the parent directory; one dot (".") represents the current directory itself. Both can be components of a complex relative path (e.g., "../mark/./bobapples"), where "." alone or as the first component of such a relative path represents the working directory. (Using "./foo" to refer to a file "foo" in the current working directory can sometimes usefully distinguish it from a resource "foo" to be found in a default directory or by other means; for example, to view a specific version of a manual page instead of the one installed in the system.)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles