Jump to content
php.lv forumi

xcopy izsauksana


Blitz

Recommended Posts

Ir divas kopesanas komandas. Copy un Xcopy. Palaizot katru atseviski ieksh cmd, viss stradaa smuki. Ja vinas izsaucu caur php ar system vai exec, tad 1) aiziet normali bet 2) itkaa izpildaas bet rada 0 files copied un protams neko nav aizkopejis. Respektivi, laizot caur cmd visu kopee, bet caur php, izradas ka nemaz nav ko kopeet.

 

komandas:

1) Copy \\linux\pasutijumi.gdb\pasutijumi.gdb d:\ /y
2) Xcopy \\piii\d$\wwwroot d:\wwwroot /y /c /d /e /z

 

Meiginaju vinas laist kaa atseviskas, tip system ("copy...") un system("Xcopy..."), kaa ari abas vienlaicigi system("copy.bat").

Pieminesu velreiz ka laizhot visas caur cmd, stradaa ideali. Un ar pirmo Copy komandu ari nav problemu, vienigi tas Xcopy.

 

Kapec? Kapec taa notiek?

Edited by Blitz
Link to comment
Share on other sites

4e4en php nelabpraat stradaa ar tikla resursiem.

 

bubu, ar backslashiem problemu nav. Izmeginaju visadi + laizot caur *.bat tacu ari tas pats gluks, un tur backslashiem nav nozimes.

Edited by Blitz
Link to comment
Share on other sites

hmm, notiek tas pats.

 

system("C:\winnt\system32\cmd.exe /c xcopy \\\piii\d$\wwwroot d:\wwwroot /y /c /d /e /z");

0 File(s) copied

system("C:\winnt\system32\cmd.exe xcopy \\\piii\d$\wwwroot d:\wwwroot /y /c /d /e /z");

0 File(s) copied

 

piebildisu ka copy stradaa labi, bet xcopy ir problemas.

Link to comment
Share on other sites

aaa sajaucu. Tatad xcopy.exe ir parasts aizpildamais fails kuram var padot parametrus tiesi ta pat ka to daru caur cmd.

 

Cik saprotu tad shaadi:

 

system("C:\\winnt\\system32\\xcopy.exe \\\\piii\\d$\\wwwroot d:\\wwwroot /y /c /d /e /z");

 

meiginaju ari saadi, ko atradu vienaa manualii:

 

system("C:\\winnt\\system32\\xcopy.exe /y /c /d /e /z \"\\\\piii\\d$\\wwwroot\" \"d:\\wwwroot\" ");

 

bet atkal nestradaa. Ko es nesapratu?

Link to comment
Share on other sites

Ja kadam gadas kas lidzigs, tad parbaudiet vai apache strada ar tadu lietotaju kam ir tiesibas darboties ar tikla resursiem zem domain kontroleta tikla :)

 

+ tas pats attiecas uz windows wokstation. Nomainit var zem services- propertiji- logon (xp, 2000).

Edited by Blitz
Link to comment
Share on other sites

×
×
  • Create New...