# Directory browser cannot handle paths contain backslash on Linux

XMLWordPrintable

#### Details

• Type: Bug
• Status: Open
• Priority: Major
• Resolution: Unresolved
• Component/s:
• Labels:
None
• Environment:
Oracle Java 1.6 update 45
Red Hat Enterprise Linux 6.4
• Similar Issues:

#### Description

We had a faulty test case that saved screenshots from Selenium tests in a hard-coded location, which happened to be "C:\Screenshots". Unsurprisingly, this didn't work properly when run on our Linux build server. It created a directory called "C:\Screenshots" in the workspace, and then files like "C:\Screenshots\XXX.png" in the workspace directory.

Obviously, we're fixing our build to not do this. However, Jenkins does not handle this case.

You can recreate this by running the following commands in a workspace:

[jenkins@build-master workspace]$mkdir "C:\Screenshots" [jenkins@build-master workspace]$ echo test > "C:\Screenshots\test.txt"

The output of ls -l will then contain entries like this:

drwxrwxr-x. 2 jenkins jenkins 4096 Oct 17 14:46 C:\Screenshots
rw-rw-r-. 1 jenkins jenkins 5 Oct 17 14:46 C:\Screenshots\test.txt

Attempts to navigate into the folder or view the file through the workspace browser will fail with a 404 error. Additionally, the directory will appear as just Screenshots and the file as test.txt, rather than their full names.

(Set priority to Trivial, as frankly, I don't expect this situation to come up again).

#### Activity

Hide
Brian Artman added a comment -

I'd like to give this a try. I'm pretty junior so if someone has a fix you can take over and I'll find something else to work on.

Show
Brian Artman added a comment - I'd like to give this a try. I'm pretty junior so if someone has a fix you can take over and I'll find something else to work on.
Hide
Daniel Beck added a comment -

Also happens with files and folders named 'foo\bar\baz', they show up as 'baz'.

Show
Daniel Beck added a comment - Also happens with files and folders named 'foo\bar\baz', they show up as 'baz'.

#### People

Assignee:
Steven Christou
Reporter:
Paul Milliken