|
|
|||||||
Hi all, I've checked the documentation and can only see functions which check if a file exists, but how can I check if a directory exists? Regards, Niall. |
||||||||
|
|
|||||||
same way, it works for both. |
||||||||
|
|
|||||||
So for a directory I'd do something like IF EXIST ("C:\Windows") and that will return 1 (true)? I need to check for the existence of a dir and if it doesn't exist, copy it from a Samba share. Can I get a code example of this? |
||||||||
|
|
|||||||
Something like this? Code:
|
||||||||
|
|
|||||||
Well a folder and a file can have the same name but not be the same object type so coding something like this might be a little better I would also recommend using KiXtart v4.52 beta 2 as some routines for file manipulation have recently been updated/corrected. Code:
|
||||||||
|
|
|||||||
Well... I would think that the simple check would suffice, assuming that in the absense of said folder one were to be created. If a file did exist of the same name, the creation of the folder would fail. |
||||||||
|
|
|||||||
Yes correct it would. If I was going to do this in script I'd have much more logic and checks in place. Basically meant that checking / verifying that someone did not have a file with that name would also be prudent, but as you pointed out would / should use much more logic and error checking. |
||||||||
|
|
|||||||
Thanks guys! |