473,394 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How do you delete a zip file from a directory?

Once again, I thought my class method deleteZip() would do the trick,
but it never deletes any .zip* file found in a directory:

[PHP]
/**
* Delete any latent ZIP files found in this album. This method is to
be inherited by all listing classes to allow for
* list-wide deletion of latent server-created ZIP files for security
purposes
*
* @access private
* @see actual_path
* @see is_class
*/
function &deleteZip() { // STATIC VOID METHOD
global $section, ${$section . 'LocationPath'}, $projectFullName;
$album = $_REQUEST['album'];
$locationPath = ($album) ? "${$section . 'LocationPath'}/$album" :
${$section . 'LocationPath'};
if (@!is_class($this->dbAP, 'DBActionPerformer')) $this->dbAP =& new
DBActionPerformer(); // LOCAL INSTANTIATION UNLESS ALREADY EXISTING
if (!$_ENV['windir']) { // UNIX VERSION
$statMsg = exec("stat \"" . actual_path($locationPath) . "/*.zip*\"
2>&1"); // USE UNIX CHECK 'stat' FOR LOCATING ANY ZIP FILES, DO
DELETION IF AT LEAST 1 FOUND
} else { // WINDOWS VERSION
list($lsKommand, $lsRedirect) =
@array_values($this->dbAP->getKommandOSArray('ls'));
$statMsg = exec("$lsKommand \"" . actual_path($locationPath) .
"/*.zip*\" $lsRedirect");
}
if (@!unlink(actual_path($locationPath) . '/*.zip*') &&
!preg_match('/no such file/i', $statMsg)) { // WEB SERVER CANNOT
DELETE ZIP FILES
list($removeKommand, $removeRedirect) =
@array_values($this->dbAP->getKommandOSArray('rmdir-force'));
$msg = exec("$removeKommand \"" . actual_path($locationPath) .
"/*.zip*\" $removeRedirect"); // ALLOW FOR THE SERVER ITSELF TO
DELETE THEM
if (preg_match('/^rm:/i', $msg) || ($_ENV['windir'] && $msg))
die("$projectFullName shut down due to security issue with
potentially damaging ZIP file in \"$locationPath\", please contact
administrator<p>Error: $msg");
}
}

[/PHP]

This is what happens:

statMsg = stat: cannot stat `/www/html/tools/app/images/doom/*.zip*':
No such file or directory
um, sorry but there *IS* at lease 1 zip file in
/www/html/tools/app/images/doom called images_of_doom.zip that is
auto-generated and does exist when I do "ls -l" via command line,
permissions of 0644.

How do I delete it and any other ZIP file, plain and simple, I thought
this would work and it doesn't, please help

thanx
phil

Oct 11 '06 #1
11 5745
To expand a wildcard pattern, try the glob function. unlink isn't able
to handle wildcards. For instance:

$zips = glob("$theDir/*.zip");
if ($zips === false) {
die("glob failed.");
}
foreach ($zips as $zip) {
unlink($zip) or die("unlink failed.");
}

comp.lang.php wrote:
Once again, I thought my class method deleteZip() would do the trick,
but it never deletes any .zip* file found in a directory:

[PHP]
/**
* Delete any latent ZIP files found in this album. This method is to
be inherited by all listing classes to allow for
* list-wide deletion of latent server-created ZIP files for security
purposes
*
* @access private
* @see actual_path
* @see is_class
*/
function &deleteZip() { // STATIC VOID METHOD
global $section, ${$section . 'LocationPath'}, $projectFullName;
$album = $_REQUEST['album'];
$locationPath = ($album) ? "${$section . 'LocationPath'}/$album" :
${$section . 'LocationPath'};
if (@!is_class($this->dbAP, 'DBActionPerformer')) $this->dbAP =& new
DBActionPerformer(); // LOCAL INSTANTIATION UNLESS ALREADY EXISTING
if (!$_ENV['windir']) { // UNIX VERSION
$statMsg = exec("stat \"" . actual_path($locationPath) . "/*.zip*\"
2>&1"); // USE UNIX CHECK 'stat' FOR LOCATING ANY ZIP FILES, DO
DELETION IF AT LEAST 1 FOUND
} else { // WINDOWS VERSION
list($lsKommand, $lsRedirect) =
@array_values($this->dbAP->getKommandOSArray('ls'));
$statMsg = exec("$lsKommand \"" . actual_path($locationPath) .
"/*.zip*\" $lsRedirect");
}
if (@!unlink(actual_path($locationPath) . '/*.zip*') &&
!preg_match('/no such file/i', $statMsg)) { // WEB SERVER CANNOT
DELETE ZIP FILES
list($removeKommand, $removeRedirect) =
@array_values($this->dbAP->getKommandOSArray('rmdir-force'));
$msg = exec("$removeKommand \"" . actual_path($locationPath) .
"/*.zip*\" $removeRedirect"); // ALLOW FOR THE SERVER ITSELF TO
DELETE THEM
if (preg_match('/^rm:/i', $msg) || ($_ENV['windir'] && $msg))
die("$projectFullName shut down due to security issue with
potentially damaging ZIP file in \"$locationPath\", please contact
administrator<p>Error: $msg");
}
}

[/PHP]

This is what happens:

statMsg = stat: cannot stat `/www/html/tools/app/images/doom/*.zip*':
No such file or directory

um, sorry but there *IS* at lease 1 zip file in
/www/html/tools/app/images/doom called images_of_doom.zip that is
auto-generated and does exist when I do "ls -l" via command line,
permissions of 0644.

How do I delete it and any other ZIP file, plain and simple, I thought
this would work and it doesn't, please help

thanx
phil
Oct 11 '06 #2

pe*******@gmail.com wrote:
To expand a wildcard pattern, try the glob function. unlink isn't able
to handle wildcards. For instance:

$zips = glob("$theDir/*.zip");
if ($zips === false) {
die("glob failed.");
}
foreach ($zips as $zip) {
unlink($zip) or die("unlink failed.");
}
Thanx but how efficient is that? You could be looping through a
directory potentially containing thousands of images within my
application each time you display a list of them

>
comp.lang.php wrote:
Once again, I thought my class method deleteZip() would do the trick,
but it never deletes any .zip* file found in a directory:

[PHP]
/**
* Delete any latent ZIP files found in this album. This method is to
be inherited by all listing classes to allow for
* list-wide deletion of latent server-created ZIP files for security
purposes
*
* @access private
* @see actual_path
* @see is_class
*/
function &deleteZip() { // STATIC VOID METHOD
global $section, ${$section . 'LocationPath'}, $projectFullName;
$album = $_REQUEST['album'];
$locationPath = ($album) ? "${$section . 'LocationPath'}/$album" :
${$section . 'LocationPath'};
if (@!is_class($this->dbAP, 'DBActionPerformer')) $this->dbAP =& new
DBActionPerformer(); // LOCAL INSTANTIATION UNLESS ALREADY EXISTING
if (!$_ENV['windir']) { // UNIX VERSION
$statMsg = exec("stat \"" . actual_path($locationPath) . "/*.zip*\"
2>&1"); // USE UNIX CHECK 'stat' FOR LOCATING ANY ZIP FILES, DO
DELETION IF AT LEAST 1 FOUND
} else { // WINDOWS VERSION
list($lsKommand, $lsRedirect) =
@array_values($this->dbAP->getKommandOSArray('ls'));
$statMsg = exec("$lsKommand \"" . actual_path($locationPath) .
"/*.zip*\" $lsRedirect");
}
if (@!unlink(actual_path($locationPath) . '/*.zip*') &&
!preg_match('/no such file/i', $statMsg)) { // WEB SERVER CANNOT
DELETE ZIP FILES
list($removeKommand, $removeRedirect) =
@array_values($this->dbAP->getKommandOSArray('rmdir-force'));
$msg = exec("$removeKommand \"" . actual_path($locationPath) .
"/*.zip*\" $removeRedirect"); // ALLOW FOR THE SERVER ITSELF TO
DELETE THEM
if (preg_match('/^rm:/i', $msg) || ($_ENV['windir'] && $msg))
die("$projectFullName shut down due to security issue with
potentially damaging ZIP file in \"$locationPath\", please contact
administrator<p>Error: $msg");
}
}

[/PHP]

This is what happens:

statMsg = stat: cannot stat `/www/html/tools/app/images/doom/*.zip*':
No such file or directory
um, sorry but there *IS* at lease 1 zip file in
/www/html/tools/app/images/doom called images_of_doom.zip that is
auto-generated and does exist when I do "ls -l" via command line,
permissions of 0644.

How do I delete it and any other ZIP file, plain and simple, I thought
this would work and it doesn't, please help

thanx
phil
Oct 11 '06 #3
"comp.lang.php" <ph**************@gmail.comwrote:
>
pe*******@gmail.com wrote:
>To expand a wildcard pattern, try the glob function. unlink isn't able
to handle wildcards. For instance:

$zips = glob("$theDir/*.zip");
if ($zips === false) {
die("glob failed.");
}
foreach ($zips as $zip) {
unlink($zip) or die("unlink failed.");
}

Thanx but how efficient is that? You could be looping through a
directory potentially containing thousands of images within my
application each time you display a list of them
You shouldn't worry too much about efficiency until you try it. Try doing
an "ls *.zip" from a command line; the "glob" is going to take roughly the
same time. The Unix directory APIs are pretty efficient.

On the other hand, once you get into "thousands" of images, you might
consider some clever subdirectories. I have a client that stores PDF and
JPG files, where the names have the form 'p12345.pdf'. I use mod_rewrite
to change that to a directory tree p1/23/p12345.pdf. That way, there are
no more than 100 files per directory.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Oct 12 '06 #4

Tim Roberts wrote:
"comp.lang.php" <ph**************@gmail.comwrote:

pe*******@gmail.com wrote:
To expand a wildcard pattern, try the glob function. unlink isn't able
to handle wildcards. For instance:

$zips = glob("$theDir/*.zip");
if ($zips === false) {
die("glob failed.");
}
foreach ($zips as $zip) {
unlink($zip) or die("unlink failed.");
}
Thanx but how efficient is that? You could be looping through a
directory potentially containing thousands of images within my
application each time you display a list of them

You shouldn't worry too much about efficiency until you try it. Try doing
an "ls *.zip" from a command line; the "glob" is going to take roughly the
same time. The Unix directory APIs are pretty efficient.
Ok cool, however, the requirements for this portable web app is that it
must work in both Unix and Windows environments equally, thus,
obviously can't just do "ls *.zip" but also "dir /w *.zip" as well; how
does "glob" play with Windows?
>
On the other hand, once you get into "thousands" of images, you might
consider some clever subdirectories. I have a client that stores PDF and
JPG files, where the names have the form 'p12345.pdf'. I use mod_rewrite
to change that to a directory tree p1/23/p12345.pdf. That way, there are
no more than 100 files per directory.
-
clever subdirectories are an option inasmuch as PHP requires literal
paths for some of its functionality (I wrote a function "actual_path()"
that takes care of that anyway), however, as this is a portable web
application, I am not sure if that is a viable one, as this application
is designed to "pack up and go" and install anywhere on the planet (or
it should), one simply could not do mod_rewrite on the fly, only an
admin customizing my tool could do that on their end. Good to suggest
though

Phil

PS: I figured something out that might work for Unix/Windows:

[PHP]
if (!$_ENV['windir'] && !$_SERVER['windir']) {
$msg = exec('stat ' . actual_path($locationPath) . '/*.zip* 2>&1');
} else {
list($lsKommand, $lsRedirect) =
@array_values($this->getKommandOSArray('ls-l')); // GETS "ls" COMMAND
APPROPRIATE FOR NON-UNIX SYSTEMS
$msg = exec("$lsKommand \"" . actual_path($locationPath) . "/*.zip*\"
$lsRedirect");
}
[/PHP]
-
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Oct 12 '06 #5
comp.lang.php wrote:
Tim Roberts wrote:

Ok cool, however, the requirements for this portable web app is that it
must work in both Unix and Windows environments equally, thus,
obviously can't just do "ls *.zip" but also "dir /w *.zip" as well; how
does "glob" play with Windows?
Why not use the directory functions, such as opendir(), readdir(), etc.?
They work on all systems. You'll have to test the file extensions,
but it shouldn't be too bad as the information is cached.

>

clever subdirectories are an option inasmuch as PHP requires literal
paths for some of its functionality (I wrote a function "actual_path()"
that takes care of that anyway), however, as this is a portable web
application, I am not sure if that is a viable one, as this application
is designed to "pack up and go" and install anywhere on the planet (or
it should), one simply could not do mod_rewrite on the fly, only an
admin customizing my tool could do that on their end. Good to suggest
though

Phil

PS: I figured something out that might work for Unix/Windows:

[PHP]
if (!$_ENV['windir'] && !$_SERVER['windir']) {
$msg = exec('stat ' . actual_path($locationPath) . '/*.zip* 2>&1');
} else {
list($lsKommand, $lsRedirect) =
@array_values($this->getKommandOSArray('ls-l')); // GETS "ls" COMMAND
APPROPRIATE FOR NON-UNIX SYSTEMS
$msg = exec("$lsKommand \"" . actual_path($locationPath) . "/*.zip*\"
$lsRedirect");
}
[/PHP]
-
>>- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.

$_SERVER['DOCUMENT_ROOT'] always points to the root directory of the
server, no matter where it is or what platform you're running Apache on
(it also works with IIS). From there is' a simple matter to append the
relative path from the document root to the directory you want.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 13 '06 #6

Jerry Stuckle wrote:
comp.lang.php wrote:
Tim Roberts wrote:

Ok cool, however, the requirements for this portable web app is that it
must work in both Unix and Windows environments equally, thus,
obviously can't just do "ls *.zip" but also "dir /w *.zip" as well; how
does "glob" play with Windows?

Why not use the directory functions, such as opendir(), readdir(), etc.?
They work on all systems. You'll have to test the file extensions,
but it shouldn't be too bad as the information is cached.



clever subdirectories are an option inasmuch as PHP requires literal
paths for some of its functionality (I wrote a function "actual_path()"
that takes care of that anyway), however, as this is a portable web
application, I am not sure if that is a viable one, as this application
is designed to "pack up and go" and install anywhere on the planet (or
it should), one simply could not do mod_rewrite on the fly, only an
admin customizing my tool could do that on their end. Good to suggest
though

Phil

PS: I figured something out that might work for Unix/Windows:

[PHP]
if (!$_ENV['windir'] && !$_SERVER['windir']) {
$msg = exec('stat ' . actual_path($locationPath) . '/*.zip* 2>&1');
} else {
list($lsKommand, $lsRedirect) =
@array_values($this->getKommandOSArray('ls-l')); // GETS "ls" COMMAND
APPROPRIATE FOR NON-UNIX SYSTEMS
$msg = exec("$lsKommand \"" . actual_path($locationPath) . "/*.zip*\"
$lsRedirect");
}
[/PHP]
-
>- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
$_SERVER['DOCUMENT_ROOT'] always points to the root directory of the
server, no matter where it is or what platform you're running Apache on
(it also works with IIS).
[snip]

That doesn't address the fact that your directory, stemming from
$_SERVER['DOCUMENT_ROOT'], could be "/var/www/html/blah/foo" or
"C:\Program Files\Apache Group\Apache\htdocs\blah\foo". Which is why I
will want to delete all of one type of file from a directory, the issue
lies in the fact that I am wanting to use command-line calls to remove
them all at one time (which honestly I thought was a time saver, but
honestly, is that slower or faster than your suggestion of opendir() -
readdir() while loop? I would think the while loop is slower as it has
to loop where a command-line remove command would be faster, but that's
just me), by using the * wildcard I cannot encase the path structure in
double-quotes, but in Windows, my directory from the doc root might
have spaces in it:

c:\Program Files\Apache Group\Apache\htdocs\My Directory\blah\foo

Why anyone would do that would be beyond me, but it is viable to occur
of course.

Also, for some strange reason, whenever I do this, it fails in spite of
the fact that $_SERVER['DOCUMENT_ROOT'] contains the path from the root
to the docroot:

[PHP]
list($removeKommand, $removeRedirect) =
@array_values($dbAP->getKommandOSArray('rmdir')); // GETS EITHER
WINDOWS OR NON-WINDOWS REMOVE COMMANDS AND REDIRECTION
$msg = exec("$removeKommand \"" . actual_path($_SERVER['DOCUMENT_ROOT']
.. '/blah/foo') . "/*.zip*\" $removeRedirect");
[/PHP]

Phil

Oct 13 '06 #7
comp.lang.php wrote:
Jerry Stuckle wrote:
<snip>
>>$_SERVER['DOCUMENT_ROOT'] always points to the root directory of the
server, no matter where it is or what platform you're running Apache on
(it also works with IIS).


[snip]

That doesn't address the fact that your directory, stemming from
$_SERVER['DOCUMENT_ROOT'], could be "/var/www/html/blah/foo" or
"C:\Program Files\Apache Group\Apache\htdocs\blah\foo". Which is why I
will want to delete all of one type of file from a directory, the issue
lies in the fact that I am wanting to use command-line calls to remove
them all at one time (which honestly I thought was a time saver, but
honestly, is that slower or faster than your suggestion of opendir() -
readdir() while loop? I would think the while loop is slower as it has
to loop where a command-line remove command would be faster, but that's
just me), by using the * wildcard I cannot encase the path structure in
double-quotes, but in Windows, my directory from the doc root might
have spaces in it:

c:\Program Files\Apache Group\Apache\htdocs\My Directory\blah\foo

Why anyone would do that would be beyond me, but it is viable to occur
of course.

Either way, $_SERVER['DOCUMENT_ROOT'] will point at your web root
directory. Just add your relative path from the root directory - which
the program should know already, anyway. It's just much easier to
reference the web server root directory all the time than to try to
compute the relative path. So you would just use:

$_SERVER['DOCUMENT_ROOT'] . '/blah/foo'

for your directory (yes, Windows understands forward slashes, also -
just the command processor doesn't).

And spaces are not a problem.

Using the PHP directory functions is going to be slower - but it is
transparent to the system. And many shared hosts do not allow PHP
programs to execute shell commands. This will always work, as long as
the files have the appropriate permissions (and if they don't, the shell
command will fail, also).
Also, for some strange reason, whenever I do this, it fails in spite of
the fact that $_SERVER['DOCUMENT_ROOT'] contains the path from the root
to the docroot:

[PHP]
list($removeKommand, $removeRedirect) =
@array_values($dbAP->getKommandOSArray('rmdir')); // GETS EITHER
WINDOWS OR NON-WINDOWS REMOVE COMMANDS AND REDIRECTION
$msg = exec("$removeKommand \"" . actual_path($_SERVER['DOCUMENT_ROOT']
. '/blah/foo') . "/*.zip*\" $removeRedirect");
[/PHP]

Phil
You don't need actual_path, for one thing. You already have it. And
not knowing what actually is passed in $removeKommand or
$removeRedirect, it's hard to say what happened.

Why not put your command into a string then echo it to see what's
actually in it? And the message that's returned.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 13 '06 #8
"comp.lang.php" <ph**************@gmail.comwrote:
>
Tim Roberts wrote:
>>
You shouldn't worry too much about efficiency until you try it. Try doing
an "ls *.zip" from a command line; the "glob" is going to take roughly the
same time. The Unix directory APIs are pretty efficient.

Ok cool, however, the requirements for this portable web app is that it
must work in both Unix and Windows environments equally, thus,
obviously can't just do "ls *.zip" but also "dir /w *.zip" as well;
I did not suggest that you actually use "ls *.zip" in your app. I
suggested that you do it ONE TIME and notice how quickly it runs, because
it uses essentially the same mechanism that "glob" will use. My purpose in
doing so was merely to reassure you that "glob" is not inefficient.
>how does "glob" play with Windows?
It works fine on Windows.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Oct 14 '06 #9

Tim Roberts wrote:
"comp.lang.php" <ph**************@gmail.comwrote:

pe*******@gmail.com wrote:
To expand a wildcard pattern, try the glob function. unlink isn't able
to handle wildcards. For instance:

$zips = glob("$theDir/*.zip");
if ($zips === false) {
die("glob failed.");
}
foreach ($zips as $zip) {
unlink($zip) or die("unlink failed.");
}
Thanx but how efficient is that? You could be looping through a
directory potentially containing thousands of images within my
application each time you display a list of them

You shouldn't worry too much about efficiency until you try it. Try doing
an "ls *.zip" from a command line; the "glob" is going to take roughly the
same time. The Unix directory APIs are pretty efficient.
I wrote a function that will be used in case you don't have shell
access as a backup, that way, you will always have a way of performing
the same functionality whether you have shell access or not.

as far as "glob" goes, I checked here
http://us3.php.net/manual/en/function.glob.php under the first note,
and this portable application could be used to access and handle remote
files, thus "glob" will fail there (thus that's why I'm not using
"glob"):

[PHP]
if (!function_exists('move_all')) {
/**
* This function will perform the moving of all files from one
directory to another. Will return boolean as other PHP file/directory
commands will do as well
*
* "move_all()" will take the place of command-line "mv
/path/to/my/files/* /new/path/for/my/files" if the system environment
does not permit usage of command-line shell access. It will
* loop through the directory and use {@link
http://us3.php.net/manual/en/function.rename.php rename()} to move each
file individually
*
* @access public
* @param mixed $origPath
* @param mixed $newPath
* @return boolean
* @see actual_path
*/
function &move_all($oldPath, $newPath) {
if (!is_dir(actual_path($oldPath))) trigger_error("\"$oldPath\" is not
a valid source directory", E_USER_WARNING);
if (!is_dir(actual_path($newPath))) trigger_error("\"$newPath\" is not
a valid destination directory", E_USER_WARNING);
$dirID = @opendir($oldPath);
while (($fyl = @readdir($dirID)) !== false) if
(@!rename(actual_path("$oldPath/$fyl"), actual_path($newPath))) return
false;
@closedir($dirID);
return true;
}
}

[/PHP]

So thanx a lot for the suggestions as it totally helps keep this
portable web app being, well, more portable!
>
On the other hand, once you get into "thousands" of images, you might
consider some clever subdirectories. I have a client that stores PDF and
JPG files, where the names have the form 'p12345.pdf'. I use mod_rewrite
to change that to a directory tree p1/23/p12345.pdf. That way, there are
no more than 100 files per directory.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Oct 19 '06 #10
comp.lang.php wrote:
>
if (@!is_class($this->dbAP, 'DBActionPerformer')) $this->dbAP =& new
DBActionPerformer(); // LOCAL INSTANTIATION UNLESS ALREADY EXISTING
I don't know about the actual unlinking of zip files, etc, but AFAIK
you can't create objects by reference. This should be:

....$this->dbAP = new DBActionPerformer();
Oct 24 '06 #11

Marcin Dobrucki wrote:
comp.lang.php wrote:

if (@!is_class($this->dbAP, 'DBActionPerformer')) $this->dbAP =& new
DBActionPerformer(); // LOCAL INSTANTIATION UNLESS ALREADY EXISTING

I don't know about the actual unlinking of zip files, etc, but AFAIK
you can't create objects by reference. This should be:

...$this->dbAP = new DBActionPerformer();
Um I'm sorry but yes you can. I've been doing this in PHP for years
with no problem:

$this->dbAP =& new DBActionPerformer();

Phil

Oct 24 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jobs | last post by:
Hello All, I want to delete all files in a directory. I am making a backup copy of all files in the directories say c:\abc by reading and writing to a file. After making a backup copy I want to...
5
by: betterdie | last post by:
Dear guru I want to delete all file and folder recursivly under php code, can anyone give me commend for this. Thank very much
3
by: News | last post by:
Is it possible to delete a file by copying it to the "bit bucket" or "null device"? Back in my youth when I live in VMS-land you could delete a file by copying it to NL: ========== I have...
12
by: Lucas Tam | last post by:
I have a very simple loop: If (Directory.Exists(tempDirectory)) Then Try Dim Files() As String = Directory.GetFiles(tempDirectory) 'Clear out directory For Each Filename As String In Files...
5
by: Sam777 | last post by:
I was under the impression that creating the app_offline.htm file at the root of the webapp would cause all handles to be closed so that the app could be removed. Unfortunately, this isn't the...
3
by: Arpan | last post by:
A Form has a FileUpload, 2 Buttons & a TextBox web server controls. Using the FileUpload control, I want to give users the provision to move & delete files that DO NOT exist in C:\Inetpub\wwwroot...
7
by: Anil Gupte | last post by:
Private Sub mnu2Exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnu2Exit.Click Dim fDir As String = Path.GetDirectoryName(L3Global.VideoFileName) ...
3
by: Steph | last post by:
hello, i ve a probleme when deleting a directory and when i want create file immediatly after. 1) Directory.Delete(myPath, true); 2) TextWriter sw = new StreamWriter(myPath +"test.aspx"); i...
0
by: wolfsbane | last post by:
Alright, here it is I am trying to write a win32 app in VB 2005 to clean up user's profiles. everything works correctly except for the Delete("directory", True) statement. I get a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.