Hi, let's say I have a program in my external hard drive and there's a code in my app that references a picture or a file in that hard drive, how do I make it so that when I take my external hard drive to another computer, even though the computer assigns a new drive to the hard drive, my code will still find the file/image?

8 Years
Discussion Span
Last Post by glenak

You could search all the drives.
Use the File class's listRoots() method to get a list of root Files.

In a more structured environment, you could use environment variables to point the external drives or memory sticks. Set them on the new computer and your code can find the stuff it needs via the path in the variable.

Edited by NormR1: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.