How do I find the path of an external hard drive plugged into my device with MatLab?

10 次查看(过去 30 天)
I am using an external hard drive on multiple devices on the same network. I need to access data on a single external hard drive across these multiple devices.
I would like to have a few lines in my code before loading the data from this external hard drive that runs a search for the hard drive name without me having to change it every time I plug the hard drive into a different device.
Is there a way to do this?

回答(1 个)

Jan
Jan 2018-4-19
The answer depends on the used operating system. Under Windows you can check the existence of a file by changing the drive letter, but this does not work under MacOS and Linux.
If you are working in a network, a trivial solution is to share your device as a network folder. Then you can access it by the UNC path (under Windows): //192.168.1.10/SharedFolder .
Why do you want to search for the "hard drive name", especially "without me having to change it every time"? Does your hard drive has a different name for each access?

类别

Help CenterFile Exchange 中查找有关 Install Products 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by