Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how read a drive content????? 1

Status
Not open for further replies.

ridifvx

Programmer
Apr 10, 2003
34
ID
Uhm a newbie question :)
well i want to read all of directory and file (*.*) from certain drive (i.e. C:\ or Cd-rom drive) and there result of it's is displayed on a single edit box..
Well i want to read the content of a cdrom and save it into memo field in my database..any sugestion please..ehat ,ethod or function in FVPthat i can use it

p.s. Sorry4 my english
 
Use ADIR() you can use it to call just particular files or all files and directories depending on the flag. You can write a function that does what your asking for, and their may even be one in the FAQ section.

Brian

From help:

ADIR(ArrayName [, cFileSkeleton [, cAttribute [, nFlag]]])

Returns:
Column Array contents Data type
1 File names Character
2 File sizes Numeric
3 Dates last modified Date
4 Times last modified Character
5 File attributes Character

Letter Attribute
A Archive – Read/Write
H Hidden
R Read-only
S System
D Directory

nFlag Description
0 (Default) Display represents the full file name in uppercase
1 Display represents original Case in names
2 Display follows DOS 8+3 naming convention

 
Get Files in Directory (including subdirectories) faq184-4256
 
@Baltman

WOW it's too fast Baltman double star for you
thanks....
 
You have to be fast around here since there are so many helpful VFP experts on TT [smile]

Brian
 
Just curious, if you display the contents of all directories and subdirectories in an editbox, how do you plan to indicate that a file is in a certain directory? Rather than an editbox, I'd use a treeview for something like this, because it's what you would see in the left pane of Windows Explorer, so it's something users are familiar with.

(Treeview can be a bit tricky, though, so I can understand why you wouldn't want to try it since you're a beginner.)


-BP (Barbara Peisch)
 
ridifvx

Another approach for when you are more familiar with VFP would be to launch an instance of Windows Explorer through the WinAPI call ShellExecute() which would start in the drive\folder of your choice.

To insert/append filename(s) or the data from file(s), you use the OLEDragDrop() of a suitable control on a VFP form.

All a user would need to do would be to drag and drop the relevant file(s) from Windows Explorer onto the control and the code in the OLEDragDrop() event would do the rest.

FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Well Mr. Chris, i just need to know what the content about the drive not content of the fullpath,
Well my apps want to read the content of CDrom, so i thinks is a good idea to put editbox,linked into a memo field..but using drag and drop is a god idea can u explain more further (ups..if u don't mind)

@Bpeisch, yeah i'm beginner :) and i need learn from expert like u all thanks, excuse me how i implemented treeview in my program thanks :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top