I am just getting back to using php for some basic maintenance functions on my systems, and took a look at using the win32api functions (just what I want!). But it would seem that win32api is no longer supplied with php (5.3.3) for windows binaries.
Can anyone help me find it, or explain why is is not a good choice??
Thanks
Locating Win32api
Moderator: General Moderators
Re: Locating Win32api
Try to use COM instead.
What kind of "maintenance"?
What kind of "maintenance"?
Re: Locating Win32api
For example, reorganizing sets of pics (jpg) across two servers based upon exif content info. A task that is 'scheduled' to run in the middle of the night.
Doing application specific backups across LAN and compressing/decompressing the files on the fly.
etc
Also, could you post an example of connecting to a network share using COM? I can't figure out where to start!!!
Doing application specific backups across LAN and compressing/decompressing the files on the fly.
etc
Also, could you post an example of connecting to a network share using COM? I can't figure out where to start!!!
Re: Locating Win32api
Okay, but why do you need the Windows API for that?griffinmt wrote:For example, reorganizing sets of pics (jpg) across two servers based upon exif content info. A task that is 'scheduled' to run in the middle of the night.
Ditto.griffinmt wrote:Doing application specific backups across LAN and compressing/decompressing the files on the fly.
As long as whoever PHP is running as (NetworkService, IUSR, etc) has access to the share you can just... use it. Windows will do the connecting.griffinmt wrote:Also, could you post an example of connecting to a network share using COM? I can't figure out where to start!!
Code: Select all
$handle = fopen("\\\\server\\share\\path\\to\\file", "r");Re: Locating Win32api
All of that is fine if you know what you want in advance.
I want to be able to enumerate all connected shares, connect to the desired share if not connected on each target system, enumerated all folders and files on these connections (along with creation/modified date etc), and so on.
Martyn
I want to be able to enumerate all connected shares, connect to the desired share if not connected on each target system, enumerated all folders and files on these connections (along with creation/modified date etc), and so on.
Martyn
Re: Trying other ways!
For now, thought I would try using some other 'methods.
The 'client' side is W7 and the 'server' side is WXP (on an isolated Lan).
On XP there is a share defined (//Gate/Wanderer) with full controll access by all users (network and local).
On W7 I am running both Apache2.2 and IE8 as the 'client'.
The following is a simple chunk of code being tested"
When I launch this, I get the following:
The 'client' side is W7 and the 'server' side is WXP (on an isolated Lan).
On XP there is a share defined (//Gate/Wanderer) with full controll access by all users (network and local).
On W7 I am running both Apache2.2 and IE8 as the 'client'.
The following is a simple chunk of code being tested"
Code: Select all
$baseout = "\\\\Gate\\Wanderer";
$dir = dir($baseout);
$dir->close();
The last error is kind of obvious, but what are the likely causes for the first error?Warning: dir(\\Gate\Wanderer,\\Gate\Wanderer): Access is denied. (code: 5) in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\dev\BakMine.php on line 20
Warning: dir(\\Gate\Wanderer): failed to open dir: No error in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\dev\BakMine.php on line 20
Fatal error: Call to a member function close() on a non-object in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\dev\BakMine.php on line 21