Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is file path a url?

I have a variable in code that can have file path or url as value. Examples:

http://someDomain/someFile.dat
file://c:\files\someFile.dat
c:\files\someFile.dat

So there are two ways to represent a file and I can't ignore any of them. What is the correct name for such a variable: path, url, location?

I'm using a 3rd party api so I can't change semantics or separate to more variables.

like image 754
Yaron Naveh Avatar asked Oct 18 '25 03:10

Yaron Naveh


1 Answers

The first two are URLs, the third is a file path. Of course, the file:/// protocol is only referring to a file also.

When using the Uri class, you can use the IsFile and the LocalPath properties to handle file:/// Uris, and in that case you should also name it like that.

like image 59
Lucero Avatar answered Oct 19 '25 18:10

Lucero



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!