#94601 - 2002-10-31 09:09 AM
Re: Best options/best way?
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
I must apologize for not working on this until now. No excuses.
As soon as we get these bits of code finalized, we should then be able to update the FAQ.
Thanks,
Kent
|
Top
|
|
|
|
#94602 - 2002-11-01 05:02 AM
Re: Best options/best way?
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
|
Top
|
|
|
|
#94603 - 2002-11-25 06:00 PM
Re: Best options/best way?
|
Bxn
Getting the hang of it
Registered: 2002-06-05
Posts: 63
Loc: Alpha Centauri
|
Kent, Yes, I'm Back Again ... but [sadly] only for a few moments. I've had to work in some very remote places and did'nt have the opportunity to check the board. Second thing which prevented me to be 'present' : The recent birth of my second son Warren ! Without URL to point to, I won't be able to put any picture of him
I'm glad [and ... proud] you took of your time to consider my remarks and hope to have soon more time to really be back again.
Cheers,
|
Top
|
|
|
|
#94604 - 2002-11-25 08:51 PM
Re: Best options/best way?
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
bxn,
Congratulations! You must be a proud poppa!
No hurry on the comments/follow-up on this.
I was glad to have somebody point out short/pitfalls encountered with these file ops.
As you may have noticed with the tile of this thread - "Best options/best way?" That I was soliciting from the user community any all feedback.
So, my hat is off to you.
Thanks again and take care of your newest member of your family.
Kent
|
Top
|
|
|
|
#94606 - 2003-08-07 02:42 PM
Re: Best options/best way?
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
With the new MOVE, here is the new version of this script -
code:
;Test environment: Windows XP ;Kix Version: 4.21+ ;Kent Dyer ;07-August-2003 ;version .81 ;Test: Create a simple text file called ScripTest and insert some text in it ;Findings: a file name and folder name of the same name cannot exist on the same volume ; also works with a zero-byte file too. ;Thanks: to bxn from http://kixtart.org for pointing out the error 183 when a file exists with ;same name as the folder ;using Kixtart commands BREAK ON CLS ;Trying To Create A Folder as Necessary $foldernametocheck = "C:\ScriptTest" $lenfolder = Len($foldernametocheck) $foldername = substr($foldernametocheck,4,$lenfolder) $drv=Left($foldernametocheck,3)
; - First check to see if this is a file IF EXIST($foldernametocheck) AND NOT (GETFILEATTR($foldernametocheck) & 16) ? $foldernametocheck + " appears to exist as a file" ?'Press Y and <ENTER> to continue and rename the file and create the folder' ?'Press N and <ENTER> to exit' ?'>' GETS $k IF $k = 'Y' IF @KIX<'4.21' SHELL '%comspec% /c ren ' + $foldernametocheck + ' ' + $foldername + 1 ELSE ;MOVE $foldernametocheck $foldername + '1' ; This deletes the file, ;you need to define the drive letter MOVE $foldernametocheck $drv+$foldername+'1' ENDIF ?'Creating '+ $foldernametocheck + ' now' MD $foldernametocheck IF @error <> 0 ?@error SLEEP 2 ENDIF ELSE RETURN ENDIF ENDIF IF EXIST($foldernametocheck) AND (GETFILEATTR($foldernametocheck) & 16) ?$foldernametocheck + ' Appears to exist as a folder.' SLEEP 2 RETURN ELSE ?'Creating ' + $foldernametocheck + ' now' MD $foldernametocheck IF @error <> 0 ?@error SLEEP 2 ENDIF ENDIF ? 'File/folder checks complete' ? 'Press any Key to exit' GET $l
Kent [ 07. August 2003, 14:43: Message edited by: kdyer ]
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 239 anonymous users online.
|
|
|