[jcifs] Creating file with hash ('#') in filename

Glass, Eric eric.glass at capitalone.com
Wed Jan 15 20:54:09 EST 2003

> Regarding the path, RFC2396 says that the following are allowed:
>       pchar         = unreserved | escaped |
>                       ":" | "@" | "&" | "=" | "+" | "$" | ","
> So the '@' is permitted but *the spaces are not*.  Actually, 
> the status of
> the spaces are not really clear to me from the given syntax.

They appear to be covered under section 2.4.3 (Excluded US-ASCII
Characters).  The relevant section is quoted below (note that '#' is a
member of the delims set and is also discussed):

   The control characters in the US-ASCII coded character set are not
   used within a URI, both because they are non-printable and because
   they are likely to be misinterpreted by some control mechanisms.

   control     = <US-ASCII coded characters 00-1F and 7F hexadecimal>

   The space character is excluded because significant spaces may
   disappear and insignificant spaces may be introduced when URI are
   transcribed or typeset or subjected to the treatment of word-
   processing programs.  Whitespace is also used to delimit URI in many

   space       = <US-ASCII coded character 20 hexadecimal>

   The angle-bracket "<" and ">" and double-quote (") characters are
   excluded because they are often used as the delimiters around URI in
   text documents and protocol fields.  The character "#" is excluded
   because it is used to delimit a URI from a fragment identifier in URI
   references (Section 4). The percent character "%" is excluded because
   it is used for the encoding of escaped characters.

   delims      = "<" | ">" | "#" | "%" | <">

   Other characters are excluded because gateways and other transport
   agents are known to sometimes modify such characters, or they are
   used as delimiters.

   unwise      = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`"

   Data corresponding to excluded characters must be escaped in order to
   be properly represented within a URI.

> They are not
> in the unreserved set, however, so the URL above is not a 
> valid URL (but
> you could probably fudge it).  The spaces also present 
> another problem,
> which you quietly side-stepped.  Most command line 
> interpreters will need
> to have URL string in quotation marks as shown, or will need 
> to have the 
> spaces escaped, order to read it.
The information transmitted herewith is sensitive information intended only
for use by the individual or entity to which it is addressed. If the reader
of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.

More information about the jcifs mailing list