Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Space in 'My Documents' directory not fixed by quoting or \ escaping

Reply
Thread Tools

Space in 'My Documents' directory not fixed by quoting or \ escaping

 
 
Lew
Guest
Posts: n/a
 
      05-29-2012
Gene Wirchenko wrote:
> Lew wrote:
>> Gene Wirchenko wrote:
>>> then hit tab. Windows will do the rest, even adding appropriate quotes where
>>> necessary. Note that you must use the Windows \ path separator for this to work.

>>
>>"/" is a Windows path *element* separator. ";" is the path separator in Windows.
>>
>>Windows is fine with forward slashes in paths. I suspect the "%1" expansion.

>
> But since using "/" as a path element seprator in a command line
> will cause trouble, people tend to avoid using them as such.


That is interesting to me. What trouble?

I have used forward slashes as path element separators in Windows
command-line commands. I don't recall that it caused any trouble.

I'm always learning from this forum.

--
Lew
 
Reply With Quote
 
 
 
 
glen herrmannsfeldt
Guest
Posts: n/a
 
      05-29-2012
Lew <(E-Mail Removed)> wrote:

(snip)
>> But since using "/" as a path element seprator in a command line
>> will cause trouble, people tend to avoid using them as such.


> That is interesting to me. What trouble?


> I have used forward slashes as path element separators in Windows
> command-line commands. I don't recall that it caused any trouble.


The system calls, such as OPEN, accept either / or \.
(C programmers use / for #include files, knowing it will work
on unix or DOS/Windows, at least since DOS 3.2.)

The system command line utilities, such as DIR and COPY use / for
options, and won't accept it as part of a file path.

Other command line utilities (that don't come with DOS/Windows)
that don't use / for options likely will accept /.

The Sourceforge UNXUTILS, unix-like utilities for WIN32,
for example, should accept /.

-- glen
 
Reply With Quote
 
 
 
 
Jim Janney
Guest
Posts: n/a
 
      05-29-2012
glen herrmannsfeldt <(E-Mail Removed)> writes:

> Lew <(E-Mail Removed)> wrote:
>
> (snip)
>>> But since using "/" as a path element seprator in a command line
>>> will cause trouble, people tend to avoid using them as such.

>
>> That is interesting to me. What trouble?

>
>> I have used forward slashes as path element separators in Windows
>> command-line commands. I don't recall that it caused any trouble.

>
> The system calls, such as OPEN, accept either / or \.
> (C programmers use / for #include files, knowing it will work
> on unix or DOS/Windows, at least since DOS 3.2.)
>
> The system command line utilities, such as DIR and COPY use / for
> options, and won't accept it as part of a file path.
>
> Other command line utilities (that don't come with DOS/Windows)
> that don't use / for options likely will accept /.
>
> The Sourceforge UNXUTILS, unix-like utilities for WIN32,
> for example, should accept /.


In early versions of MS-DOS you could put a line in CONFIG.SYS to set
the switch character to something else, usually -, which then freed up /
for use in file names. This eventually went away, I don't remember
exactly when. The problem was never in the API but in user code that
parsed command lines.

--
Jim Janney

 
Reply With Quote
 
bilsch
Guest
Posts: n/a
 
      05-29-2012
On 5/29/2012 2:55 PM, Gene Wirchenko wrote:
> On Tue, 29 May 2012 14:07:29 -0700 (PDT), Lew<(E-Mail Removed)>
> wrote:
>
>> Gene Wirchenko wrote:
>>> Lew wrote:
>>>> Gene Wirchenko wrote:
>>>>> then hit tab. Windows will do the rest, even adding appropriate quotes where
>>>>> necessary. Note that you must use the Windows \ path separator for this to work.
>>>>
>>>> "/" is a Windows path *element* separator. ";" is the path separator in Windows.
>>>>
>>>> Windows is fine with forward slashes in paths. I suspect the "%1" expansion.
>>>
>>> But since using "/" as a path element seprator in a command line
>>> will cause trouble, people tend to avoid using them as such.

>>
>> That is interesting to me. What trouble?
>>
>> I have used forward slashes as path element separators in Windows
>> command-line commands. I don't recall that it caused any trouble.

>
> I checked with Windows XP just before posting. The CLI did not
> like
> dir /download
> and no wonder since "/" is used in many command-line programs for
> indicating parameters. Windows 7 behaves the same way. (I just
> checked.)
>
> It is easier to just use backslashes and not have to worry if
> slash is acceptable in the current context. I prefer just typing and
> not having to think about typing.
>
>> I'm always learning from this forum.

>
> So do I.
>
> Sincerely,
>
> Gene Wirchenko


Forward slash works
 
Reply With Quote
 
Nigel Wade
Guest
Posts: n/a
 
      05-30-2012
On 29/05/12 15:06, Lew wrote:
> Nigel Wade wrote:


>>
>> it's often very convenient to use tab expansion of paths (both in
>> Windows cmd
>> shell, and UNIX/Linux bash shell). This would have discovered the
>> correct path
>> for the OP. For example, enter in the cmd.exe:
>>
>> javac -d C:\Users\Owner\My
>>
>> then hit tab. Windows will do the rest, even adding appropriate quotes
>> where
>> necessary. Note that you must use the Windows \ path separator for
>> this to work.

>
> "/" is a Windows path *element* separator. ";" is the path separator in
> Windows.
>
> Windows is fine with forward slashes in paths.
>


But not in tab-expansion, as I said.


--
Nigel Wade

 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      06-02-2012
bilsch wrote:
> Gene Wirchenko wrote:
>> Lew wrote:
>>
>>> Gene Wirchenko wrote:
>>>> Lew wrote:
>>>>> Gene Wirchenko wrote:
>>>>>> then hit tab. Windows will do the rest, even adding appropriate quotes
>>>>>> where
>>>>>> necessary. Note that you must use the Windows \ path separator for this
>>>>>> to work.
>>>>>
>>>>> "/" is a Windows path *element* separator. ";" is the path separator in
>>>>> Windows.
>>>>>
>>>>> Windows is fine with forward slashes in paths. I suspect the "%1" expansion.
>>>>
>>>> But since using "/" as a path element seprator in a command line
>>>> will cause trouble, people tend to avoid using them as such.
>>>
>>> That is interesting to me. What trouble?
>>>
>>> I have used forward slashes as path element separators in Windows
>>> command-line commands. I don't recall that it caused any trouble.

>>
>> I checked with Windows XP just before posting. The CLI did not
>> like
>> dir /download
>> and no wonder since "/" is used in many command-line programs for
>> indicating parameters. Windows 7 behaves the same way. (I just
>> checked.)
>>
>> It is easier to just use backslashes and not have to worry if
>> slash is acceptable in the current context. I prefer just typing and
>> not having to think about typing.
>>
>>> I'm always learning from this forum.

>>
>> So do I.
>>
>> Sincerely,
>>
>> Gene Wirchenko

>
> Forward slash works


That settles it, then.

--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedi.../c/cf/Friz.jpg
 
Reply With Quote
 
Gene Wirchenko
Guest
Posts: n/a
 
      06-04-2012
On Sat, 02 Jun 2012 09:31:57 -0700, Lew <(E-Mail Removed)> wrote:

>bilsch wrote:
>> Gene Wirchenko wrote:
>>> Lew wrote:


[snip]

>>>> I have used forward slashes as path element separators in Windows
>>>> command-line commands. I don't recall that it caused any trouble.
>>>
>>> I checked with Windows XP just before posting. The CLI did not
>>> like
>>> dir /download
>>> and no wonder since "/" is used in many command-line programs for
>>> indicating parameters. Windows 7 behaves the same way. (I just
>>> checked.)
>>>
>>> It is easier to just use backslashes and not have to worry if
>>> slash is acceptable in the current context. I prefer just typing and
>>> not having to think about typing.
>>>
>>>> I'm always learning from this forum.
>>>
>>> So do I.


>> Forward slash works

>
>That settles it, then.


Hardly. I mentioned where I checked it, and it most definitely
did not work.

Sincerely,

Gene Wirchenko
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
Why Python style guide (PEP-8) says 4 space indents instead of 8 space??? 8 space indents ever ok?? Christian Seberino Python 21 10-27-2003 04:20 PM
Re: Why Python style guide (PEP-8) says 4 space indents instead of8 space??? 8 space indents ever ok?? Ian Bicking Python 2 10-24-2003 11:15 AM
Re: Why Python style guide (PEP-8) says 4 space indents instead of8 space??? 8 space indents ever ok?? Ian Bicking Python 2 10-23-2003 07:07 AM
Stack space, global space, heap space Shuo Xiang C Programming 10 07-11-2003 07:30 PM



Advertisments