|
possible 100% java implentation for chdir: msg#00036lang.jython.devel
I realize
chdir is not a high priority and there have been postings
saying
that a 100% java implementation is not possible--however, I
(perhaps naively) suggest it is
possible and provide source
(attached).
Would this be of interest
to give jython a chdir?
-Clark
Sample jython session (assumes presence of dir
C:\temp):
Jython 2.1 on java1.3.1_01 (JIT: null)
Type "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path.append("C:\\temp") >>> import CurrentDir as CD >>> cDir = CD("C:\\temp") >>> cDir.mkdir("aDirectory") 1 >>> cDir.cd("aDirectory") >>> cDir.mkdir("test") 1 >>> cDir.cd("test") >>> from java.io import File >>> File(cDir.toFile(), "dummy.txt").createNewFile() 1 >>> cDir.list() array(['dummy.txt'], java.lang.String) >>> cDir.delete("dummy.txt") 1 >>> cDir.list() array([], java.lang.String) >>> cDir.renameTo("test_renamed") 1 >>> cDir.cd("..") >>> cDir.list() array(['test_renamed'], java.lang.String) >>> cDir.delete("test_renamed") 1 >>> cDir.cd("..") >>> cDir.delete("aDirectory") 1 >>>
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [ jython-Patches-859555 ] Rework _cmp_unsafe; test_compare passes, SourceForge.net |
|---|---|
| Next by Date: | Interact with Jython from a Java Program., msc97kxp |
| Previous by Thread: | status of Jython?, Brian Durney |
| Next by Thread: | RE: possible 100% java implentation for chdir, Jeff Emanuel |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |