Subject: Could not touch file when specify full path in Cygwin in .bat file
From: [email-masked]
To: <[email-masked]>
Cc: <[email-masked]>
Date: Mon, 12 Jun 2006 15:22:05 -0400

Hi, Cygwin support group,

I have problem to touch a file when specify the full path. Here are some examples. MKS works fine

-- Filename with special characters
D:\>touch D:\usr\meta\boxster\UNITw2kMixednew\boxster_UNITw2kMixednew_0205\Tree\!@#$%&()_+.!@#$%&()_+
) was unexpected at this time.

-- With the quote on filename
D:\>touch D:\usr\meta\boxster\UNITw2kMixednew\boxster_UNITw2kMixednew_0205\Tree\"!@#$%&()_+.!@#$%&()_+"

touch: cannot touch `D:\\usr\\meta\\boxster\\UNITw2kMixednew\\boxster_UNITw2kMixednew_0205\\Tree\\!@#$%&()_+.!@#$%&()_+': No such file or directory

-- We can touch a file with the double quota in DOS cmd window.
D:\>touch  "D:\usr\meta\boxster\boxster_UNITw2kMixednew\boxster_UNITw2kMixednew_0205\Tree\!@#$%()_+.!@#$%&()_+"

D:\usr\meta\boxster\boxster_UNITw2kMixednew\boxster_UNITw2kMixednew_0205\Tree>ls

!@#$%()_+.!@#$%&()_+

--- If we put this touch command in windows batch file -- (clone.bat) file, it won't work.

SET TEST_SERVER=D:\usr\meta\boxster\UNITw2kMixednew\boxster_UNITw2kMixednew_0205\Tree
touch "%TEST_SERVER%\!@#$%%^&()_+.!@#$%%^&()_+"                     <== (we try touch without quote, same result)

--- run .bat file
D:\usr\meta\boxster\boxster_UNITw2kMixednew\boxster_UNITw2kMixednew_0205>cmd /c clone.bat
touch: cannot touch `D:\\usr\\meta\\boxster\\UNITw2kMixednew\\boxster_UNITw2kMixednew_0205\\Tree\\!@#$%^&()_+.!@#$%^&()_+': No such file or directory

Do you know why is that and how do we make it work in .bat file?

Thanks a lot for your help!

Xiaomin

EMC² 
Where Information Lives
Xiaomin Wu
Phone#: 508-305-8783
Ext: 48783
E-mail: [email-masked]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/