Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Slashes in file names

Reply
Thread Tools

Slashes in file names

 
 
JDS
Guest
Posts: n/a
 
      03-01-2005
On Tue, 01 Mar 2005 19:00:58 +0000, tshad wrote:

> So when I am getting images or going from page to page (redirects) on my
> system I should always use "\", correct?
>
> When I use http:, I should always use http://xxx/xx/.
>
> Thanks,
>
> Tom


Inside HTML pages and CSS, *always* use forward slashes. "/" -- on the
question mark key. So for your original example, ALL of the slashes
should be forward-slashes! ALL OF THEM. The text was text inside an HTML
page. HTML only uses the forward-slash as a directory delimeter.

If you have a Windows PC, use Back-slashes in, for example, Windows
Explorer, to navigate directories, or on the MS-DOS command prompt. "\" --
on the "pipe" key, usually.

Technically speaking, to answer the Subject: line of the OP, "slashes" are
not part of the file name. They indicate the file path.

--
JDS | http://www.velocityreviews.com/forums/(E-Mail Removed)lid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

 
Reply With Quote
 
 
 
 
JDS
Guest
Posts: n/a
 
      03-01-2005
On Tue, 01 Mar 2005 19:49:23 +0000, tshad wrote:

>
> I read in another article that you could use "~//", but that doesn't seem to
> work here:
>
> <script language="javascript" src="~//includes/Menus.js"></script>


The tilde ("~") character is a Unix-ism (and Linux, too) that means "My
Home Directory". Tilde is (essentially) meaningless on Windows.

The extra slash is probably just a typo -- the only time you use two
slashes is between the protocol indicator ("http:" or "ftp:" for example)
and the path.

--
JDS | (E-Mail Removed)lid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

 
Reply With Quote
 
 
 
 
JDS
Guest
Posts: n/a
 
      03-01-2005
On Tue, 01 Mar 2005 18:58:33 +0000, David Dorward wrote:

> ... assuming you use Windows. UNIX based systems (like Linux, BSD or Mac OS
> X) use forward slashes as directory seperators.


And MacOS < X used colons -- ":"

--
JDS | (E-Mail Removed)lid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

 
Reply With Quote
 
Blinky the Shark
Guest
Posts: n/a
 
      03-01-2005
JDS wrote:

> The tilde ("~") character is a Unix-ism (and Linux, too) that means
> "My Home Directory". Tilde is (essentially) meaningless on Windows.


To the extent that to most Windows users, it's probably "that little
wavy thing."

--
Blinky Linux Registered User 297263
Who has implemented Usenet Solution #45933:
Now killing all posts originating at Google Groups

 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      03-01-2005
Carolyn Marenger wrote:
> saz wrote:
>
>> Forward "/" is for internet use, or for files located outside your
>> network and computer.
>>
>> Backwards "\" is for local networks and your personal computer.

>
> Actually the "\" is used in windows environments. Possibly some others
> as well. I can't comment about the mac line, but in linux, my OS of
> choice, / is used for directories, servers, and so forth.


Actually, on the DOS/Windows filesystem, "/" and "\" are interchangeable,
though "\" is convention. And some particular DOS/Windows applications
will insist on a "\".

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
Dan
Guest
Posts: n/a
 
      03-01-2005

tshad wrote:
> What about if I want it to be relative to the root folder (not c:,

but the
> virtual directory root)?
>
> Something like:
>
> <script language="javascript" src="\includes\Menus.js"></script>


URLs always use forward slashes. Even "file:" URLs referring to local
system files use forward slashes even though the local operating system
convention might use backslashes.

For relative URLs to the root, you would use
src="/includes/Menus.js".

--
Dan

 
Reply With Quote
 
tshad
Guest
Posts: n/a
 
      03-01-2005

"Dylan Parry" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> tshad wrote:
>
>> <script language="javascript" src="\includes\Menus.js"></script>

>
> Nope. You still use "/" here. Any time you use a slash within HTML
> code[1], it should be a forward slash.
>


But that still doesn't find the root directory (at least, I can't seem to
make it work).

> ____
> 1. Except when you are actually attempting to display the backslash
> character in, for example, a paragraph of text.
>
> --
> Dylan Parry
> http://webpageworkshop.co.uk -- FREE Web tutorials and references



 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      03-01-2005
tshad wrote:

>> Nope. You still use "/" here. Any time you use a slash within HTML
>> code[1], it should be a forward slash.


> But that still doesn't find the root directory (at least, I can't seem to
> make it work).


It should find the root directory, of course if you are accessing it over
your local file system then the root is c:\ (or whatever drive it is). You
are usually best off installing a local webserver
<http://httpd.apache.org/> for testing if you want to use root relative
URIs.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
JDS
Guest
Posts: n/a
 
      03-01-2005
On Tue, 01 Mar 2005 20:12:53 +0000, Blinky the Shark wrote:

> To the extent that to most Windows users, it's probably "that little
> wavy thing."


Right. I can't tell you how many times I would read out a URL that had a
tilde in it (personal home page or whatever) to someone on the phone and
they would say "not working not working not working" and I'd find out
later that they had actually typed the *word* "tilde" in the URL

e.g. http://example.com/tildejeff

instead of
http://example.com/~jeff

And I would go over and poke their eyes out and rescind their computer use
privileges and poop on their 5-and-a-quarters[1] and have my cat pee in
their punchcard reader (assuming that they had that particularly advanced
I/O device) and and then I'd yell at them and tell them that their momma
was a Timex Sinclair and then I'd really get mad and mess them up. yeah.
Then I'd put my Apple IIc in their butt sideways and tell them to take it
up with Jef Raskin. Ah...how I loved that IIc.


[1] Don't know what that is? Sheesh.

--
JDS | (E-Mail Removed)lid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

 
Reply With Quote
 
JDS
Guest
Posts: n/a
 
      03-01-2005
On Tue, 01 Mar 2005 21:21:33 +0000, David Dorward wrote:

> It should find the root directory, of course if you are accessing it over
> your local file system then the root is c:\ (or whatever drive it is). You
> are usually best off installing a local webserver
> <http://httpd.apache.org/> for testing if you want to use root relative
> URIs.


Ah, yes. Good advice.

--
JDS | (E-Mail Removed)lid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RegEx: odd number of slashes? and too many slashes? Dan Wilkin Perl Misc 1 07-17-2006 03:47 AM
radeditor/dataset/slashes/System.Data.DBConcurrencyException Henrik de Jong ASP .Net 0 06-18-2004 01:20 PM
FAQ: slashes in your filenames??? Julie C++ 10 04-13-2004 02:33 PM
String replacement( 2 slashes-> 4 slashes ) qazmlp Java 5 04-07-2004 10:26 PM
Using slashes as querystring Nils N ASP .Net 2 02-08-2004 09:37 PM



Advertisments