Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report