If you have been developing Windows, you can run it in Linux.ProgramThe usage of directories must be the same as that of me. The principle is very simple, because Linux does not support "/" and Windows supports "/", it has always been like this. The use of Linux native "/" is naturally no problem, fopen in windows, createfile, openfile, CreateProcess, and so on are not used once or twice, and there is no problem with the use. Of course, today, the problem is coming, and the debugging will be depressing.
About shfileoperation. No error returned for this damn FunctionCodeThe execution fails. getlasterror may return a number other than systemerror in msdn. So the nightmare began. When I use "/" as a regular expression of directories and test code, only one layer of directories can be used successfully, that is, E: /data directory execution is normal. But when the directory is very multi-layer, shfileoperation can also be successful, but sometimes it fails. I have repeatedly entered the parameter for verification. (It is worth noting that the input parameter ends with a double zero) until I crash. When you want to directly use CreateProcess to call commands such as copy/y and del to complete the task, you just remember that "/" is used to represent parameters in DOS (the so-called shell bar in Windows .... Using "/" to indicate a directory to call the doscommand will always fail ....... The name of sh... Shell ..... Everything is clear .... It should be noted that this is not described in msdn, and even if I use "/" to indicate the Directory and call shfileoperation, there is still a success .... In more cases, it is not a complete failure, and it is half done ....... It's too unreasonable, and there's no errorcode .......
In addition, we are looking for some decompressed libraries to complete the update operation in the monitoring system. I searched for the zlib, 7-zip support library, and so on one afternoon. If I found that RAR is not supported, the usage is unknown, or Linux is not supported. Finally, I found that it was not suitable, the unrar command line tool can actually complete the task ....... It's nothing more than a familiar CreateProcess. I'm amazed that I wrote a series of articles for the doscommand, I forgot it when I got to the project application .... In fact, sometimes it is much easier to use a command line tool than to find a library ....