Home  >  Article  >  Backend Development  >  PHP cannot generate a temporary file similar to .pid that identifies the process

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

WBOY
WBOYOriginal
2016-07-25 08:57:421022browse
  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


Statement:
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