PHP cannot generate a temporary file similar to .pid that identifies the process

WBOY
Release: 2016-07-25 08:57:42
Original
1020 people have browsed it
  1. $filename = "/tmp/test_php.pid";
  2. $fp = fopen($filename, 'w');
  3. //unset($fp);
  4. unlink($filename );
  5. sleep(6);
Copy code

2, C program code

  1. #include

  2. int main()

  3. {
  4. char *filename = "/tmp/test_c.pid";
  5. FILE *fp;
  6. fp = fopen(filename, "w");
  7. unlink(filename);
  8. sleep(6);
  9. }

Copy code


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!