Search code examples
javaiojava-server

Do we need seperate file path for window and linux in java


I have a file on linux ubuntu server hosted with path name /home/kishor/project/detail/. When I made a web app in window to upload and download file from specified location i used path "c:\kishor\projects\detail\" for saving in window.

For my surprise when i used window file path name in my server i am still able to get files and upload them, i.e, "c:\kishor\projects\detail\".

Can anyone explain why it is working (as window and linux both use different file path pattern).


Solution

  • I've seen this work too. What linux does is create a file whose name is literally c:\kishor\projects\detail\