aspose file tools*
The moose likes I/O and Streams and the fly likes Read short DOS filename Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Read short DOS filename" Watch "Read short DOS filename" New topic
Author

Read short DOS filename

Dirk Schumacher
Greenhorn

Joined: Sep 06, 2006
Posts: 8
Hello,

my dad wants to list the MSDOS short file names:
i.e. afilename.txt = afilenam~.txt

I know that the java.io.File does not implement a method for returning such a short name.
Is there any MSDOS-FILE-API able to do that. Is there any algoriothm to compute the short filename from the long one?

I'm thankful for any suggestions.
Greets
Dirk
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8971
    
    9

Java is intended to be cross-platform, so where a particular platform takes a big diversion from what is shared, it tends to pass on implementing that functionality. There may be something in the Windows API you could use. Maybe use Runtime.exec() to invoke "dir" and get what you want.


[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Read short DOS filename