0

I'm new user of this forum. i want to ask my problem. what is command in windows if i have these commands in linux ?

first command :

if (!is_dir('geoip')) mkdir('geoip', 0744);
shell_exec('unzip -oj GeoLiteCity.zip -d geoip/');

Second command :

shell_exec('rm -rf geoip/');

what are those commands in windows? thanks for the help. sorry for my english.

Marcel N.
  • 13,726
  • 5
  • 47
  • 72
dinda
  • 19
  • 2
  • 8
  • You shouldn't do that. PHP offers cross-OS compatible functions for [creating](http://de3.php.net/manual/en/function.mkdir.php)/[removing](http://www.php.net/manual/en/function.rmdir.php) folders and [unzipping](http://www.php.net/manual/en/class.ziparchive.php). Use them. – user123444555621 Jun 24 '12 at 09:41
  • Okay @Pumbaa80, thanks for your suggest. I'll keep to use that code. – dinda Jun 24 '12 at 09:45

1 Answers1

0

Windows does not have a built-in command to unzip a file, although it's possible to install InfoZip which has the same command-line arguments as zip does on Linux.

The command to delete a directory in Windows is rd /s /q geoip but there are various ways to recursively delete a directory in PHP, the latest of which is to use the new recursive directory iterator, such as mentioned on the answers to Recursive delete.

Community
  • 1
  • 1
Neil
  • 54,642
  • 8
  • 60
  • 72