Page 1 of 1 1
Topic Options
#97535 - 2003-01-07 06:08 PM Unable to use DEL
Microcyb Offline
Getting the hang of it

Registered: 2002-12-30
Posts: 95
Loc: Hell
Very odd, but maybe you might know why this is happening.

using the varibles:
$path = 'C:\windows\test'
$file = dir($Path + '\*.doc')

to generate a report with a simple while statment:
while $file <> "" and @error = 0
------> del $file
loop
$file = dir()

now the report works just fine, but the del $file does not, and was wonderring why?
_________________________
www.microcyb.com

Top
#97536 - 2003-01-07 06:09 PM Re: Unable to use DEL
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Use
code:
? 'Error '+@ERROR+' - '+@SERROR

to display the error codes generated by DEL. Potential permissions problem?
_________________________
There are two types of vessels, submarines and targets.

Top
#97537 - 2003-01-07 06:10 PM Re: Unable to use DEL
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Think you might need to append the $PATH to $FILE to get a fully qualified pathname.
Top
#97538 - 2003-01-07 06:11 PM Re: Unable to use DEL
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
yep.. you need to add $path to $file.

That has gotten me more than once...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#97539 - 2003-01-07 06:12 PM Re: Unable to use DEL
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
That gets me every time too !
Top
#97540 - 2003-01-07 06:35 PM Re: Unable to use DEL
Microcyb Offline
Getting the hang of it

Registered: 2002-12-30
Posts: 95
Loc: Hell
Yep you were right!!!

I had to do a simple $foo = $path + "\" + $file
then a del $foo in order to get the full pathing.

Thanks!!!!!
_________________________
www.microcyb.com

Top
#97541 - 2003-01-08 06:28 PM Re: Unable to use DEL
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
BTW, the FullFile() UDF will create a fully qualified file/foldername based on two fragments, independent of whether there are backslashes or not.

[ 08. January 2003, 18:28: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.062 seconds in which 0.031 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org