Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Api for ADIR
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00156185
Message ID:
00156541
Vues:
50
>Hi George,
>
>To perform a similar function that Mark was wanting to do (Return a listing of folders only), I am using something like oFile = CREATEOBJECT("Filer.Fileutil") and passing the parameter to start in root, return all files (*.*) and include subdirectories. Later I can retrieve just the path of each file returned through oFiles.Path, which in essence gives me every folder on the drive. I work my way through the oFile.Files[x] and insert each oFile.Path and oFile.Name into an existing table, filtering out any unwanted files according to file extension or date modified.
>
>I had questions when I began to code this as to what potential problems I might be opening myself up to, but so far it has worked fine. (At an engineering office, one of the reasons we did this was to check the entire network, about 65 users, and retrieve the just the CAD drawings that had changed that day and backup just those files to a network drive. Some of the users are 95, NT, and SGI using NFS for a connection)
>
>Of course the above is a simplified example of the code, as I had to use the API to connect to each user and then check their folders and files, then disconnect. But given Mark's original question, would you see this as a solution for him?
>
>I would be interested in knowing:
>---------------------------------
>1) If this method would do what Mark needs by simply retrieving the oFiles.Path
>2) You see any hidden uh-oh's or gotchas that I've overlooked
>3) There are any distribution issues (VFP was loaded on the client's PC in my situation)
>
>Any input is appreciated,

Hi Patric,

First, yes it would meet Mark's needs, but there's one real big problem (I'll tackle that last). Second, there's no problem here that I'm aware of, but I haven't researched it much beyond the documentation. Third, and this is the biggie, it's not distributable. If the user has VFP installed, fine. Otherwise, nope can't use it. This, in and of itself is enough for me to elminate it as a potential solution. None of my users have VFP installed, so as far as I'm concerned, it's not worth pursuing.

Naturally, I'm a bit prejudiced, but I like my solution the best. There are several things I don't like about ADIR(). It returns the file/directories name in all upper case, rather than the case they were entered in. It returns only the last modification date and time, and then in separate columns rather than a single date/time, and does not give you access to the creation or last access date/times. Finally, you're almost required to do a lot of changing of the default directory to ensure that all the directory names are properly returned. It's one big advantage is that it's faster than anything we could code.

Admittedly, I haven't examined Ed's suggestion. I could be that he's found a better method. If so, I'll be the first to say, "use that".

Regards,
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform