Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2008
    Posts
    165

    Find File On Drive(s)

    I know I can sometimes be a pain in the backside always asking for hep and not always giving back, so I thought I would give back to the community by adding a sample app for a bit of code I needed but couldn't find to fit my requirements.

    This is an example to find a file and returns the drive letter the file is stored on.

    Edit the app's 'On Click' action and replace Yourfile.here with the file you want, then run it and it will search in the root directory of all drives and display the result in a dialog message, then you could use it how I did, by using the result variable to point to that drive, ie:
    Code:
    writable_path = path_parts.Drive.."\\Tester\\"
    I know this is probably out there as general knowledge, but it took me a long time to search & fine tune the script for my needs, and I hope it will be of use to somebody at least! :-)

    Code:
    tbDrives = Drive.Enumerate();
    for i,v in tbDrives do
    		--replace Yourfile.here with the file you wish to find
    		tbFile = File.Find(v, "Yourfile.here", false, false, nil, nil);
    		if not tbFile then
    			else
    			path_parts = String.SplitPath(tbFile[1]);
    			Dialog.Message("File found on Drive:", path_parts.Drive.."\\", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
               end
         end

  2. #2
    Join Date
    Dec 2009
    Posts
    1
    thank you frind

  3. #3
    Join Date
    Nov 2009
    Posts
    10
    A thousand thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts