Get the App
SLTechnology News&Howtos  ›  Servers  › 

There is no problem with the linux file path of window and linux project deployment.

Shulou Source: shulou.com Published: 2022-06-02 02:34:42 10月01日 Update

I haven't written a blog for a long time. Last week, I tested the project and found some bugs. One of them is a little confusing. It is described as follows:

Project deployment on windows, upload pictures function is normal, deployment to linux server, then inexplicable error (probably retarded, actually forgot *linux and windows file directory difference *)

Normally it should be like this:

Actually, it's like this:

Potato, who had never encountered such a problem, was also a little confused. No matter what, the project should be restarted first. If it was invalid, then look at tomcat, or if it was invalid. It was too difficult for me. As a senior chicken programmer, I naturally have the third, fourth and fifth solutions (baidu,google, etc.), with the spirit of not giving up, continue to continue, okk, brother I found, hahaha, on the mood at this time, it is like the vast sea of people, I met you.

Careful analysis of the problem, it turns out that this is the case, the file storage path under windows is:

path += "\\" + dirName + "\\" + ymd + "\\";

The result on Linux would be:

This is obviously different from the path we expected. Yes, at this time, I believe that some students with a little computer foundation can see what the problem is. Yes, it is correct. It is to change\to/ok. It is really always smart and cool. It is destroyed for a long time.

Compare:

//Note here that Linux and Windows are different, Linux uses\, Windows uses// /*path += "\\" + dirName + "\\" + ymd + "\\"; pathsrc += "\\" + dirName + "\\" + ymd + "\\";*/ path += "/" + dirName + "/" + ymd + "/"; pathsrc += "/" + dirName + "/" + ymd + "/";

summary

The above is a small editor to introduce you to the window and linux project deployment linux file path there is no problem, I hope to help you, if you have any questions please give me a message, small editor will reply to you in time. Thank you very much for your support!

If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!

Tags: Problems projects files paths differences mental retardation help yes obvious incomprehensible witty no matter three seven twenty-one sea of people never provenance function blog classmate consequence brother Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Apple Shulou Information MariaDB Shulou Tech Info