For Programmers: Free Programming Magazines  


Home > Archive > APL > May 2005 > Renaming or deleting directories in APL+Win









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Renaming or deleting directories in APL+Win
Don Wiss

2005-05-04, 3:56 am

I'd like to either delete or rename directories as part of my picture site
creating program. You can't rename, as you can't tie to a directory. And
the []rmdir only works on empty directories. These never are. I could use
[]cmd and issue DOS commands. But are there some more elegant APIs that I
can use?

Don <www.donwiss.com> (e-mail link at home page bottom).
apl

2005-05-04, 3:56 am

Don Wiss wrote:
> I'd like to either delete or rename directories as part of my picture site
> creating program. You can't rename, as you can't tie to a directory. And
> the []rmdir only works on empty directories. These never are. I could use
> []cmd and issue DOS commands. But are there some more elegant APIs that I
> can use?
>
> Don <www.donwiss.com> (e-mail link at home page bottom).


Use the MoveFile API call.

#wcall 'MoveFile' ('c:\path\OldDirName',#tcnul) ('c:\path\NewDirName',#tcnul)

MoveFile should be defined in the ADF file. If not, it is:
MoveFile=B(*C lpExistingFileName, *C lpNewFileName) ALIAS MoveFileA LIB Kernel32


..qed
AA2e72E

2005-05-04, 3:55 pm

To delete a folder (empty or not) try:

[]wself{comes from}'fso' []wi 'Create' 'Scripting.FileSystemObject'
[]wi 'XDeleteFolder' 'c:\New Folder'


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com