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

Christopher R. Hertel crh at ubiqx.mn.org
Tue Jan 14 05:29:37 EST 2003

In general (not just in the draft) once the URL is parsed the individual 
pieces should be URL decoded.  Parse first, decode second.  Then the 
filename portion (or the pathname, depending on how it gets figured out) 
would be converted to "test#1.txt".

I took the fragmentation paragraph out of the latest draft because,
basically, it doesn't make any sense to use fragmentation in a filesharing
protocol.  It makes sense for http because it *knows* that it will be
dealing with hypertext.  Still, a general-purpose parser will see the # as
a fragment delimiter, so it should be escaped.

I assume that there is some point at which the information passes from the 
Java URL class to the jCIFS code.  This is probably the point at which the 
escapes could be translated and removed from the strings.

Chris -)-----

On Mon, Jan 13, 2003 at 12:43:26PM -0500, Michael B. Allen wrote:
> On Mon, 13 Jan 2003 09:06:49 -0800
> Thomas Krammer <TKrammer at nxn-software.com> wrote:
> > Hi everyone,
> > 
> > I'm trying to create a file with a hash mark ('#') in the filename on a SMB
> > server. This works fine using the Windows Explorer but fails when I try it
> > using jCIFS 0.7.0.
> > 
> > When I'm using the SMB URL "smb://server/share/test#1.txt" a file named
> > "test" is created because the "#1.txt" is interpreted as the fragment part
> > of the URL.
> > 
> > When I URL encode the hash mark ("smb://server/share/test%231.txt") a file
> > named "test%231.txt" gets created.
> > 
> > Looking at the "SMB Filesharing URL Scheme" document I didn't find any
> > information how to encode the path component of the SMB URL.
> > 
> > Did I miss something or is it simply not possible? 
> No. It's currently not possible to reference such a file. I've known
> about this for a while but I have not quite come up with a solution.
> Actually this is your area Chris. What does the latest draft way :~)
> -- 
> A  program should be written to model the concepts of the task it
> performs rather than the physical world or a process because this
> maximizes  the  potential  for it to be applied to tasks that are
> conceptually  similar and, more important, to tasks that have not
> yet been conceived. 

Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org

More information about the jcifs mailing list