command line (WinXP)

Egor Bolonev ebolonev at rol.ru
Sun Jul 6 04:04:44 CEST 2003


Hello, All!

I have made a module(see below) and have discovered a strange behaviour in
comand line mode:

=========Beginning of the citation==============
C:\...y Music\Katatonia\Last Fair Deal Gone Down>dir "/p"
 Volume in drive C has no label.
 Volume Serial Number is 0C80-479F

 Directory of C:\

File Not Found
=========The end of the citation================

When I use _dir /p_ everything is OK.

=========Beginning of the citation==============
C:\...y Music\Katatonia\Last Fair Deal Gone Down>dir /p
 Volume in drive C has no label.
 Volume Serial Number is 0C80-479F

 Directory of C:\Documents and Settings\rc\My Documents\My
Music\Katatonia\Last Fair Deal Gone Down

06.07.2003  09:42    <DIR>          .
06.07.2003  09:42    <DIR>          ..
05.07.2003  10:17         1 801 345 Katatonia[-+mark+-]Last Fair Deal Gone
Down[-+mark+-]Chrome[-+m
ark+-]2[-+mark+-]2001[-+mark+-]Metal.ogg
06.07.2003  09:25         1 577 448 Katatonia[-+mark+-]Last Fair Deal Gone
Down[-+mark+-]Clean Toda
y[-+mark+-]7[-+mark+-]2001[-+mark+-]Metal.ogg
05.07.2003  10:19         1 921 208 Katatonia[-+mark+-]Last Fair Deal Gone
Down[-+mark+-]Disposessi
on[-+mark+-]1[-+mark+-]2001[-+mark+-]Metal.ogg
06.07.2003  09:27         1 972 274 Katatonia[-+mark+-]Last Fair Deal Gone
Down[-+mark+-]Don`t Tell
 A Soul[-+mark+-]11[-+mark+-]2001[-+mark+-]Metal.ogg
06.07.2003  09:32         2 007 636 Katatonia[-+mark+-]Last Fair Deal Gone
Down[-+mark+-]I Transpir
e[-+mark+-]5[-+mark+-]2001[-+mark+-]Metal.ogg
06.07.2003  09:33         1 269 293 Katatonia[-+mark+-]Last Fair Deal Gone
Down[-+mark+-]Passing Bi
rd[-+mark+-]9[-+mark+-]2001[-+mark+-]Metal.ogg
06.07.2003  09:35         1 343 946 Katatonia[-+mark+-]Last Fair Deal Gone
Down[-+mark+-]Sweet Nurs
e[-+mark+-]10[-+mark+-]2001[-+mark+-]Metal.ogg
05.07.2003  10:20         1 180 590 Katatonia[-+mark+-]Last Fair Deal Gone
Down[-+mark+-]Teargas[-+
mark+-]4[-+mark+-]2001[-+mark+-]Metal.ogg
06.07.2003  09:36         1 845 629 Katatonia[-+mark+-]Last Fair Deal Gone D
own[-+mark+-]The Future
 Of Speech[-+mark+-]8[-+mark+-]2001[-+mark+-]Metal.ogg
06.07.2003  09:37         1 399 310 Katatonia[-+mark+-]Last Fair Deal Gone
Down[-+mark+-]Tonight`s
Music[-+mark+-]6[-+mark+-]2001[-+mark+-]Metal.ogg
05.07.2003  10:21           914 480 Katatonia[-+mark+-]Last Fair Deal Gone
Down[-+mark+-]We Must Bu
ry You[-+mark+-]3[-+mark+-]2001[-+mark+-]Metal.ogg
              11 File(s)     17 233 159 bytes
               2 Dir(s)  14 596 743 168 bytes free
=========The end of the citation================

So, why _dir /p_ and _dir "/p"_ work not identically? Whereas _ren 1 2_ and
_ren "1" "2"_ work identically.

_The module:_
=========Beginning of the citation==============
from os import system

#example cmd='copy',args=['c:\\1.txt','1-2 3.txt']
#= os.system('copy' + ' \"' + 'c:\\1.txt' + '\"' + ' \"' + 'c:\\1.txt')
#=copy "c:\1.txt" "1-2 3.txt"
def myossystem(cmd,args=[]):
    for i in args:
        cmd=cmd+' \"'+i+'\"'
    system(cmd)

if __name__ == '__main__':
    myossystem('dir', ['/p'])

    #while 1:pass
=========The end of the citation================

With best regards, Egor Bolonev.  E-mail: ebolonev at rol.ru [ru eo en]





More information about the Python-list mailing list