valid URL's - file names ?

Discussion in 'HTML' started by Bob, Dec 19, 2003.

  1. Bob

    Bob Guest

    Is it legit to have a URL/file name that starts with a number
    like "4x2.gif" ? I'd be interested in comments for URL's (i.e.
    I want to meet the spec as well as be platform compatible)
    Bob, Dec 19, 2003
    #1
    1. Advertising

  2. Trevor George, Dec 19, 2003
    #2
    1. Advertising

  3. Jukka K. Korpela, Dec 19, 2003
    #3
  4. Bob

    Richard Guest

    Bob wrote:

    > Is it legit to have a URL/file name that starts with a number
    > like "4x2.gif" ? I'd be interested in comments for URL's (i.e.
    > I want to meet the spec as well as be platform compatible)



    Who cares? we have domain names that use 1-800 don't we?
    I've seen all kinds of numbers in the url's.

    Google image search results.
    Searched images for 4x2.gif. Results 1 - 20 of about 837.

    Welcome to the club.
    Richard, Dec 20, 2003
    #4
  5. Bob

    Hunter Guest

    "Bob" <> wrote in message
    news:...
    > Is it legit to have a URL/file name that starts with a number
    > like "4x2.gif" ? I'd be interested in comments for URL's (i.e.
    > I want to meet the spec as well as be platform compatible)


    Bob - yes - it's Ok to hae number in file names.

    The rest of your post makes very little sense - I think you need to go back
    to the drawing board.
    Why do you have url/file name ? They have nowt to do with each other.
    Why are you talking about platforms ? Whose platform ? The client ? The
    server ? What difference does it make ? I guess maybe you mean
    non-alphanumeric characters or something ?

    This from the unix man:

    Filenames
    Filenames can be up to 255 characters long and can contain upper and lower
    case characters, numbers, and special characters.
    Examples:

    a.. money
    b.. lost+found
    c.. Eeap.01.91
    d.. Money
    The above are all unique and valid filenames. Note that UNIX is very case
    sensitive.

    Alternatively - if you are on windoze they ever allow spaces (although
    highly NOT recommended).

    david
    Hunter, Dec 20, 2003
    #5
  6. Bob wrote:

    > Is it legit to have a URL/file name that starts with a number
    > like "4x2.gif" ?


    A better file name might be just "4x2" -- that way you can switch to a
    different format when you want, without needing to worry about updating
    any pages that refer to it.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, Dec 20, 2003
    #6
  7. Toby A Inkster wrote:
    > A better file name might be just "4x2" -- that way you can switch to a
    > different format when you want, without needing to worry about updating
    > any pages that refer to it.


    But be sure to make your server send the correct MIME type.
    Leif K-Brooks, Dec 20, 2003
    #7
  8. Bob

    Bob Guest

    On Sat, 20 Dec 2003 03:04:29 GMT, "Hunter" <>
    wrote:

    >Alternatively - if you are on windoze they ever allow spaces (although
    >highly NOT recommended).


    Yes David, that was my point. I know that there are some odd
    things allowed by MS-windows... and as long as everyone uses
    the same OS for everything, it works. I don't want to do anything
    that would "work" today but not meet the spec since I might find
    a server OS, or browser enforcing the spec tomorrow and run into
    problems.
    Bob, Dec 22, 2003
    #8
  9. Bob

    Bob Guest

    On Fri, 19 Dec 2003 18:04:02 +0000 (UTC), "Jukka K. Korpela"
    <> wrote:

    >Bob <> wrote:
    >
    >> Is it legit to have a URL/file name that starts with a number
    >> like "4x2.gif" ?

    >
    >Yes, there's nothing to prevent that. Check the URL specifications if
    >in doubt.


    Thanks for the responses.
    Bob, Dec 22, 2003
    #9
  10. Hunter wrote:

    > This from the unix man:
    >
    > Filenames can be up to 255 characters long and can contain upper and
    > lower case characters, numbers, and special characters.
    >
    > Alternatively - if you are on windoze they ever allow spaces (although
    > highly NOT recommended).


    FYI, Unix allows spaces in file names too. In general, Unix file names are
    far more flexible than Windows ones (try creating a file called "CON" in
    Windows!)

    Unix file names can contain a range of characters not allowed on Windows:
    asterisks, question marks, reverse solidus, colons, even new line
    characters!

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, Dec 22, 2003
    #10
  11. Bob

    rf Guest

    "Toby A Inkster" <> wrote in message
    news:p...

    > Unix file names can contain a range of characters not allowed on Windows:
    > asterisks, question marks, reverse solidus, colons, even new line
    > characters!


    Er, the latter would be for multi-line files then?

    Cheers
    Richard.
    rf, Dec 23, 2003
    #11
  12. rf wrote:

    > "Toby A Inkster" <> wrote in message
    > news:p...
    >
    >> Unix file names can contain a range of characters not allowed on Windows:
    >> asterisks, question marks, reverse solidus, colons, even new line
    >> characters!

    >
    > Er, the latter would be for multi-line files then?


    I don't know what you mean by multi-line files. Most non-binary files
    contain more than one line of text.

    It is pretty hard to create a file with a new line character in it (you
    can't just open up OpenOffice and save one -- it won't let you) but here
    is a script illustrating that it can be done.

    ============================================
    #!/usr/bin/perl

    $filename = "line one\nline two.txt";
    open(FILE, ">$filename");
    print FILE 'Testing';
    close(FILE);
    ============================================

    This will create a file called:

    line one
    line two.txt

    If you try to look at it using the "ls" command, ls gets confused and
    prints out a question mark instead of the new line character. However the
    "find" command will let you see that it really does have a new line
    character in it.

    To delete:

    rm -i line\ one?line\ two.txt

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, Dec 23, 2003
    #12
  13. Toby A Inkster wrote:
    > This will create a file called:
    >
    > line one
    > line two.txt
    >
    > To delete:
    >
    > rm -i line\ one?line\ two.txt



    Interesting. If I create a file which is really called "line one?line
    two.txt", rm prompts for both of them and calls the one with the new
    line "line one\nline two.txt".
    Leif K-Brooks, Dec 23, 2003
    #13
  14. Leif K-Brooks wrote:

    > Toby A Inkster wrote:
    >> This will create a file called:
    >>
    >> line one
    >> line two.txt
    >>
    >> To delete:
    >>
    >> rm -i line\ one?line\ two.txt

    >
    >
    > Interesting. If I create a file which is really called "line one?line
    > two.txt", rm prompts for both of them


    This is expected.In the "rm" command above, the ? is a wildcard and can
    match any character, including newline ioor the question mark itself.

    > and calls the one with the new
    > line "line one\nline two.txt".


    This is unusual I guess, but is in keeping with the fact that programs in
    general don't seem to have a consistant way of printing the names of files
    with a new line character in them in a consistent way. (e.g. ls uses a ?,
    find uses a real new line, rm uses a c-style \n)

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, Dec 26, 2003
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jukka K. Korpela
    Replies:
    3
    Views:
    759
    Michael Winter
    Mar 6, 2004
  2. Michael Winter
    Replies:
    4
    Views:
    574
    Lasse Reichstein Nielsen
    Mar 6, 2004
  3. DU
    Replies:
    0
    Views:
    4,010
  4. fBechmann
    Replies:
    0
    Views:
    389
    fBechmann
    Jun 10, 2004
  5. Sfdesigner Sfdesigner
    Replies:
    5
    Views:
    153
    Chris Shea
    Aug 13, 2007
Loading...

Share This Page