လက်ရှိတည်နေရာ: ပင်မစာမျက်နှာ> ဖန်ရှင်အမျိုးအစားများ> popen

popen

Open Process ဖိုင်ညွှန်ပြ
အမည်:popen
အမျိုးအစား:ဖိုင်စနစ်
programming language:php
တစ်ကြောင်းဖြင့်အကျဉ်းချုပ်:လုပ်ငန်းစဉ်ကိုဖွင့်ပါ။

အဓိပ္ပါယ်နှင့်အသုံးပြုမှု

popen() လုပ်ဆောင်ချက်သည် Process file pointer ကိုဖွင့်သည်။

နမူနာ

 <? PHP
$ file = Popen ( "/ bin / ls" , "r" ) ,

// ကွပ်မျက်ခံရဖို့အချို့သောကုဒ်

PCLOESE ( $ file ) ;
>

သဒ္ဒါ

 Popen ( command , mode )
တေးရေး ဖေါ်ပြ
အမိန့် လိုအပ်ပါတယ် ကွပ်မျက်ခံရခံရဖို့အမိန့်ကိုသတ်မှတ်ပါ။
ထုံးနည်း

လိုအပ်ပါတယ် Connection Mode ကိုသတ်မှတ်ပါ။

ဖြစ်နိုင်သောတန်ဖိုးများ:

  • R: သာဖတ်ပါ။
  • W: သာ (လက်ရှိဖိုင်များကိုဖွင့ ်. ရှင်းလင်းခြင်းသို့မဟုတ်ဖိုင်အသစ်တစ်ခုဖန်တီးပါ)

ဥပမာပြပါ

ဆင်းသက်လာသော command command command ကိုကွပ်မျက်ခြင်းဖြင့်ထုတ်လုပ်သည့်လုပ်ငန်းစဉ်တစ်ခုသို့ပိုက်လိုင်းကိုဖွင့်သည်။

တူညီသော file pointer ကို fopen() အဖြစ်သို့ပြန်ပို့သည်။ ၎င်းသည်တစ်လမ်းတည်း (စာဖတ်ခြင်းသို့မဟုတ်ရေးခြင်းအတွက်သာ) နှင့် pclose() နှင့်ပိတ်ထားရမည်။ ဤညကို fgets() , fgetss() နှင့် fwrite() အတွက်အသုံးပြုနိုင်ပါသည်။

အမှားတစ်ခုဖြစ်ပေါ်ပါကမှားယွင်းစွာပြန်လာသည်။

သက်ဆိုင်သောဖင်ခှ်ရှင်းများ
  • Disk_Free_space အတွက် alias ကို diskfreespace

    diskfreespace

    Disk_Free_spaceအတွက်
  • ဖိုင်၏ inode ပြုပြင်မွမ်းမံအချိန်ကိုရယူပါ filectime

    filectime

    ဖိုင်၏inodeပြုပြင်မွ
  • လမ်းကြောင်းအတွက်ဖိုင်အမည်အပိုင်းကိုပြန်သွားပါ basename

    basename

    လမ်းကြောင်းအတွက်ဖိုင
  • ဖိုင် pointer အနေအထားကိုပြန်လှည့်ပါ rewind

    rewind

    ဖိုင်pointerအနေအထားက
  • ဖိုင်တစ်ခုလုံးကို string တစ်ခုထဲသို့ဖတ်ပါ file_get_contents

    file_get_contents

    ဖိုင်တစ်ခုလုံးကိုstr
  • ဒေတာကိုဖိုင်တစ်ခုရေးပါ file_put_contents

    file_put_contents

    ဒေတာကိုဖိုင်တစ်ခုရေး
  • Realpath cache entry ကိုရယူပါ realpath_cache_get

    realpath_cache_get

    Realpathcacheentryကိ
  • stream_set_write_buffer အတွက် alias ကို set_file_buffer

    set_file_buffer

    stream_set_write_buf