有關exec()在linux上的使用 - Linux

By Anthony
at 2011-02-01T20:51
at 2011-02-01T20:51
Table of Contents
這有一個程式是用python寫的
然後我現在要用php用system call的方式
把這個程式的output出來成為一個xml的格式
<?
$now=date("Y-m-d-h-i");
$newfile=fopen("/home/wei/outputs/".$now.".txt",'w+')
//建立一個可寫的檔案然後是空白的
exec("cd /home/wei/app");
exec("/home/wei/app/app.py 參數 >/home/wei/outputs/".$now.".txt");
//把她輸出的結果輸到該txt檔
可是就很奇怪不能work
但如果我沒丟變數的話
就有辦法寫進去那個檔案裏面
有人知道為什麼嗎?有點不知道在這裡問恰不恰當拜託大家了
--
然後我現在要用php用system call的方式
把這個程式的output出來成為一個xml的格式
<?
$now=date("Y-m-d-h-i");
$newfile=fopen("/home/wei/outputs/".$now.".txt",'w+')
//建立一個可寫的檔案然後是空白的
exec("cd /home/wei/app");
exec("/home/wei/app/app.py 參數 >/home/wei/outputs/".$now.".txt");
//把她輸出的結果輸到該txt檔
可是就很奇怪不能work
但如果我沒丟變數的話
就有辦法寫進去那個檔案裏面
有人知道為什麼嗎?有點不知道在這裡問恰不恰當拜託大家了
--
Tags:
Linux
All Comments

By Franklin
at 2011-02-03T12:12
at 2011-02-03T12:12

By Daniel
at 2011-02-07T14:09
at 2011-02-07T14:09

By Skylar Davis
at 2011-02-09T23:36
at 2011-02-09T23:36

By Franklin
at 2011-02-13T14:50
at 2011-02-13T14:50

By Caitlin
at 2011-02-17T12:11
at 2011-02-17T12:11

By Thomas
at 2011-02-21T14:30
at 2011-02-21T14:30

By Quintina
at 2011-02-22T08:54
at 2011-02-22T08:54

By Agatha
at 2011-02-25T08:25
at 2011-02-25T08:25

By Cara
at 2011-02-25T15:22
at 2011-02-25T15:22

By Lily
at 2011-02-26T12:12
at 2011-02-26T12:12

By Andrew
at 2011-03-01T15:47
at 2011-03-01T15:47

By Anonymous
at 2011-03-04T11:02
at 2011-03-04T11:02
Related Posts
衝筆電前先問一下

By Frederica
at 2011-02-01T17:39
at 2011-02-01T17:39
service httpd start failed?

By George
at 2011-01-31T13:28
at 2011-01-31T13:28
etc備份

By Zanna
at 2011-01-31T11:27
at 2011-01-31T11:27
etc備份

By Adele
at 2011-01-31T10:32
at 2011-01-31T10:32
如何移除雙系統之一

By Rae
at 2011-01-31T06:32
at 2011-01-31T06:32