Pathname Manipulations

  • Thread starter Lawrence D'Oliveiro
  • Start date
L

Lawrence D'Oliveiro

As I understand it, java.io.File is supposed to be the place to provide
manipulations of pathnames. Just comparing it
<http://developer.android.com/reference/java/io/File.html> to the Python
equivalent <http://docs.python.org/library/os.path.html>
<http://docs.python.org/py3k/library/os.path.html> shows how limited it is:
no equivalent to join, splitext or (shudder) splitdrive; while Java has
isfile and isdir equivalents, there is no islink or ismount; there is exists
but no lexists. And wouldn’t it be nice to have expanduser and expandvars as
well?
 
D

Daniele Futtorovic

As I understand it, java.io.File is supposed to be the place to provide
manipulations of pathnames. Just comparing it
<http://developer.android.com/reference/java/io/File.html> to the Python
equivalent<http://docs.python.org/library/os.path.html>
<http://docs.python.org/py3k/library/os.path.html> shows how limited it is:
no equivalent to join, splitext or (shudder) splitdrive; while Java has
isfile and isdir equivalents, there is no islink or ismount; there is exists
but no lexists. And wouldn’t it be nice to have expanduser and expandvars as
well?

http://java.sun.com/developer/technicalArticles/javase/nio/
http://openjdk.java.net/projects/nio/javadoc/index.html
 
R

Roedy Green

As I understand it, java.io.File is supposed to be the place to provide
manipulations of pathnames. Just comparing it
<http://developer.android.com/reference/java/io/File.html> to the Python
equivalent <http://docs.python.org/library/os.path.html>
<http://docs.python.org/py3k/library/os.path.html> shows how limited it is:
no equivalent to join, splitext or (shudder) splitdrive; while Java has
isfile and isdir equivalents, there is no islink or ismount; there is exists
but no lexists. And wouldn’t it be nice to have expanduser and expandvars as
well?

Gosling and Joy were never big on sugar. They felt that if they
provided the essential building blocks, their job was done.

See http://mindprod.com/jgloss/filesanddirectories.html for a survey
of what is provided. Most of the other stuff you need you can knock
off pretty easily. Unfortunately, that means everyone does it a
slightly different way.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top