Works for me, but reminder that sort() is case-sensitive.

Jython 2.1 on java1.3.1_02 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> import os
>>> dirs=os.listdir('c:/winnt')
>>> dirs
['addins', 'AppPatch', 'ARJ.PIF', 'asfchop.exe', 'autorun.INI', 'Blue Lace 16.bmp', 'CCNTR2.INI', 'clock.avi', 'Cmousecc.ini', 'Coffee Bean.

bmp', 'COM+.log', 'comsetup.log', 'Config', 'Connection Wizard', 'control.ini', 'CSC', 'Cursors', 'cwcdata', 'Debug', 'delttsul.exe', 'deskt

op.ini', 'Directx.log', 'discover.exe', 'Downloaded Program Files', 'Driver Cache', 'explorer.exe', 'explorer.scf', 'FeatherTexture.bmp', 'f

older.htt', 'Fonts', 'frontpg.ini', 'FSISU.log', 'Gone Fishing.bmp', 'Greenstone.bmp', 'Help', 'hh.exe', 'hpbafd.ini', 'icccodes.dll', 'iccs

igs.dat', 'IIS Temporary Compressed Files', 'iis5.log', 'imsins.BAK', 'imsins.log', 'inf', 'Installer', 'ioAccess.dll', 'iSsDIfg.cfg', 'IsUn

inst.exe', 'java', 'KawaPro.ini', 'KeyHH.exe', 'KisEIBg.dat', 'KPCMS.INI', 'kpcp32.dll', 'kpsys32.dll', 'LHA.PIF', 'Media', 'mmdet.log', 'Mo

demDet.txt', 'msagent', 'msapps', 'msdfmap.ini', 'msdownld.tmp', 'msslp.hlp', 'mww32', 'my.ini', 'NOCLOSE.PIF', 'NOTEPAD.EXE', 'ocgen.log',

'ockodak.log', 'ODBC.INI', 'ODBCINST.INI', 'odbctst.INI', 'OEWABLog.txt', 'Offline Web Pages', 'oraodbc.ini', 'pbdsdcs.ini', 'pfpick.dll', '

php.ini', 'PKUNZIP.PIF', 'PKZIP.PIF', 'PowerReg.dat', 'Prairie Wind.bmp', 'Profiles', 'RAR.PIF', 'Razor.CAB', 'RBuilder.ini', 'RealTracer.IN

I', 'regedit.exe', 'Registration', 'REGLOCS.OLD', 'repair', 'Rhododendron.bmp', 'River Sumida.bmp', 'Santa Fe Stucco.bmp', 'SBCONFIG.INI', '

SchedLgU.Txt', 'security', 'SET38.tmp', 'setupact.log', 'setupapi.log', 'setuperr.log', 'setuplog.txt', 'ShellIconCache', 'ShellNew', 'Soap

Bubbles.bmp', 'softpeg.ini', 'Solobug.INI', 'Speech', 'sprof32.dll', 'ST6UNST.000', 'ST6UNST.001', 'ST6UNST.002', 'ST6UNST.003', 'ST6UNST.EX

E', 'Sti_Trace.log', 'system', 'system.ini', 'system32', 'TASKMAN.EXE', 'Tasks', 'Temp', 'TestTrack Pro Client.INI', 'twain.dll', 'twain_32'

, 'twain_32.dll', 'twunk_16.exe', 'twunk_32.exe', 'UC.PIF', 'uedit32.cfg', 'UnGins.exe', 'uninst.exe', 'unlite25.exe', 'unvise32.exe', 'unvi

se32qt.exe', 'upwizun.exe', 'vb.ini', 'vbaddin.ini', 'vmmreg32.dll', '', 'Web', 'welcome.exe', 'welcome.ini', 'win.ini', 'wina

mp.ini', 'winhelp.exe', 'winhlp32.exe', 'winnt.bmp', 'winnt256.bmp', 'winrep.exe', 'WMEncoder.log', 'wmsetup.log', 'WMSysPrx.prx', 'wsftperr

.log', 'Zapotec.bmp', '_default.pif']
>>> dirs.sort()
>>> dirs
['ARJ.PIF', 'AppPatch', 'Blue Lace 16.bmp', 'CCNTR2.INI', 'COM+.log', 'CSC', 'Cmousecc.ini', 'Coffee Bean.bmp', 'Config', 'Connection Wizard

', 'Cursors', 'Debug', 'Directx.log', 'Downloaded Program Files', 'Driver Cache', 'FSISU.log', 'FeatherTexture.bmp', 'Fonts', 'Gone Fishing.

bmp', 'Greenstone.bmp', 'Help', 'IIS Temporary Compressed Files', 'Installer', 'IsUninst.exe', 'KPCMS.INI', 'KawaPro.ini', 'KeyHH.exe', 'Kis

EIBg.dat', 'LHA.PIF', 'Media', 'ModemDet.txt', 'NOCLOSE.PIF', 'NOTEPAD.EXE', 'ODBC.INI', 'ODBCINST.INI', 'OEWABLog.txt', 'Offline Web Pages'

, 'PKUNZIP.PIF', 'PKZIP.PIF', 'PowerReg.dat', 'Prairie Wind.bmp', 'Profiles', 'RAR.PIF', 'RBuilder.ini', 'REGLOCS.OLD', 'Razor.CAB', 'RealTr

acer.INI', 'Registration', 'Rhododendron.bmp', 'River Sumida.bmp', 'SBCONFIG.INI', 'SET38.tmp', 'ST6UNST.000', 'ST6UNST.001', 'ST6UNST.002',

 'ST6UNST.003', 'ST6UNST.EXE', 'Santa Fe Stucco.bmp', 'SchedLgU.Txt', 'ShellIconCache', 'ShellNew', 'Soap Bubbles.bmp', 'Solobug.INI', 'Spee

ch', 'Sti_Trace.log', 'TASKMAN.EXE', 'Tasks', 'Temp', 'TestTrack Pro Client.INI', 'UC.PIF', 'UnGins.exe', 'WMEncoder.log', 'WMSysPrx.prx', '

Web', 'Zapotec.bmp', '_default.pif', 'addins', 'asfchop.exe', 'autorun.INI', 'clock.avi', 'comsetup.log', 'control.ini', 'cwcdata', 'delttsu

l.exe', 'desktop.ini', 'discover.exe', 'explorer.exe', 'explorer.scf', 'folder.htt', 'frontpg.ini', 'hh.exe', 'hpbafd.ini', 'iSsDIfg.cfg', '

icccodes.dll', 'iccsigs.dat', 'iis5.log', 'imsins.BAK', 'imsins.log', 'inf', 'ioAccess.dll', 'java', 'kpcp32.dll', 'kpsys32.dll', 'mmdet.log

', 'msagent', 'msapps', 'msdfmap.ini', 'msdownld.tmp', 'msslp.hlp', 'mww32', 'my.ini', 'ocgen.log', 'ockodak.log', 'odbctst.INI', 'oraodbc.i

ni', 'pbdsdcs.ini', 'pfpick.dll', 'php.ini', 'regedit.exe', 'repair', 'security', 'setupact.log', 'setupapi.log', 'setuperr.log', 'setuplog.

txt', 'softpeg.ini', 'sprof32.dll', 'system', 'system.ini', 'system32', 'twain.dll', 'twain_32', 'twain_32.dll', 'twunk_16.exe', 'twunk_32.e

xe', 'uedit32.cfg', 'uninst.exe', 'unlite25.exe', 'unvise32.exe', 'unvise32qt.exe', 'upwizun.exe', 'vb.ini', 'vbaddin.ini', 'vmmreg32.dll',

'', 'welcome.exe', 'welcome.ini', 'win.ini', 'winamp.ini', 'winhelp.exe', 'winhlp32.exe', 'winnt.bmp', 'winnt256.bmp', 'winrep

.exe', 'wmsetup.log', 'wsftperr.log']


> -----Original Message-----
> From: Deirdre Kong []
> Sent: Thursday, August 15, 2002 07:38
> To:
> Subject: [Jython-users] sorting
> Hi,
> I am trying to get the list of files in a directory and sort them.
> I tried:
> import os
> dirs=os.listdir('c:/windows')
> dirs.sort()
> However, dirs.sort() is not sorting at all.  Does anyone know what is
> wrong?
> Thanks,
> Deirdre
> -------------------------------------------------------
> This email is sponsored by: OSDN - Tired of that same old
> cell phone?  Get a new here for FREE!
> _______________________________________________
> Jython-users mailing list