C:\ on a Mac

Posted:
in macOS edited January 2014
Out of curiousity, what would happen if you click a link to file:///C\? Like this:



Copy this into the address bar

Code:


file:///C\



Comments

  • Reply 1 of 12
    mcqmcq Posts: 1,543member
    Well, since I don't believe OS X recognizes a file URI, you'd get this in your console.log



    2004-05-30 11:32:05.216 Camino[2097] JS error: Security Error: Content at http://forums.appleinsider.com/showt...threadid=42557 may not load or link to file:///C:/.
  • Reply 2 of 12
    Or this from safari:



    No file exists at the address ?/C:?.
  • Reply 3 of 12
    Quote:

    Originally posted by MCQ

    Well, since I don't believe OS X recognizes a file URI...



    Is that some religious thing? 'Cos the reality is, of course, somewhat different.
  • Reply 4 of 12
    mr. memr. me Posts: 3,221member
    Quote:

    Originally posted by psgamer0921

    Out of curiousity, what would happen if you click a link to file:///C:/? Like this:



    Click here




    Clearly nothing important. MacOS X 10 and MS-DOS have different directory naming conventions. However, your URL should not work on MS-DOS (or Windows). UNIX and its derivatives use forward slashes like this (/) whereas MS-DOS and its derivatives use back slashes like this (\\).
  • Reply 5 of 12
    phroggyphroggy Posts: 63member
    Quote:

    Originally posted by psgamer0921

    Out of curiousity, what would happen if you click a link to file:///C:/? Like this:



    Click here




    Well I'll be....



    If you don't put that third slash (it's not "file:///[whatever]"... when was the last time you saw "http:///"?), it brought me right to the the root of the hard drive.



    Try it.
  • Reply 6 of 12
    kickahakickaha Posts: 8,760member
    Quote:

    Originally posted by Phroggy

    Well I'll be....



    If you don't put that third slash (it's not "file:///[whatever]"... when was the last time you saw "http:///"?)




    Actually, it is.



    file://<filepath>

    http://<webpath>



    A webpath starts with the server name: www.apple.com/macosx/



    A filepath starts with a slash: /Applications/Utilities/



    Triple slash is correct for file URIs.
  • Reply 7 of 12
    mcqmcq Posts: 1,543member
    Oops My mistake.
  • Reply 8 of 12
    psgamer0921psgamer0921 Posts: 393member
    Oops, I realized that it should be "file:///C\"



    (Since a link wont work, just paste

    Code:


    file:///C\





    into the address bar)
  • Reply 9 of 12
    scottscott Posts: 7,431member
    I guess you could name a file that.
  • Reply 10 of 12
    talksense101talksense101 Posts: 1,738member
    They should disallow access to the filesystem via file:// once the browser has been used in a http:// session. If browsers want to use file:// there should be some prerequisite authentication of some kind.
  • Reply 11 of 12
    scottscott Posts: 7,431member
    NOT a bad idea.
  • Reply 12 of 12
    miggs97miggs97 Posts: 87member
    Watch as the address bar icon changes as you navigate.



    Eg. file:///Applications/



    Maybe a further sign of Finder/ Safari integration? Interesting that Camino can't do this, but Mozilla can.
Sign In or Register to comment.