• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Read short DOS filename

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic