Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unix vs Windows file parsing

 
Branko Paskutini
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have a question about the following requirement from the instructions (let me try this quote thingy):

Specifically, you should document clear, simple command lines that allow your programs to be run on any Java 2 platform, regardless of the underlying hardware and operating system

Too easy . Now, if I send a file as an argument to the program, under Windows I found that I have to specify the drive letter (ie, //client//db//db.db does not work, while E://client//db//db.db does work). Even though I am running the java command from the E: drive.
I don't know much about Unix, but I know that it doesn't have drive letters like Windows does. And I assume that the first example would be the correct argument under Unix. So how can I give them the command line which will work "regardless of the underlying operating system"?
Thanks, Branko.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first one is more like what you want. You cannot use drive letters.
You need to remember that these paths are relative when you don't have a "Drive Letter"
Mark
 
Branko Paskutini
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark, thank you for your reply. If I go with the absolute path and I don't use drive letter and start the path with /, shouldn't it start from the root? Doesn't look like it (under NT). And I don't have access to the Unix box, so I can only hope this would work under Unix. I was hoping I would not have to use relative path, I don't really want to force them to install db.db and policy files in the subdirectories below where the jar file will be. But, at least it will work under NT and Unix.
I was talking to the VMS guy who said the command I am trying to use would not work under VMS. Dash has to be replaced by forward slash and the path has the format of <dir.dir>. The command required would look like:

I can imagine on MVS the format would be different again. So there is no way I can give them the command line which will work regardless of the OS. Ah, the wonders of interoperability
Thanks, Branko
 
Branko Paskutini
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, my mistake. When I use single forward slash instead of double, I don't need drive letter. All is good.
As for my second comment (VMS, MVS, Mac), should we pretend they don't exist?
Thanks, Branko.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic