Traversing Directories

Does anyone know if there is a way to Traverse Directories with AppleScript? I need to find folders within folders based on a number. For instance I need to find a folder named "8754 MyFolder", and this folder is within a containing folder. I did a search of the postings in the forum, but nothing is really what I'm looking for. If anyone knows where I can look at some example code I would appreciate it.

Why not script a Spotlight search instead?
Because a Spotlight search a) requires that Spotlight indexing is on, and b) will only show files that existed the last time the Spotlight index was updated.
Granted, this may not be a problem, and the faster execution time may be more advantageous than a real-time search, but they are things to consider.
As for the real-time question, there are two basic approaches to recursive searches in AppleScript.
One is a truly recursive script, the other is to leverage the Finder's 'entire contents' command:
tell application "Finder"
  set filesToFind to every folder of (entire contents of folder "Path:to:top:folder:" whose name is "8754 MyFolder"
  reveal filesToFind
end tell
The main drawback with this is that 'entire contents of...' can be very slow for large directory trees (don't try this on the top level of your disk, for example). For small directories it's not a big issue, though.
For a recursive script, use something like (untested):
on FindaFolder(folderName, folder2Search)
  global foundItems
  tell application "Finder"
    if exists folder folderName of folder folder2Search then
      copy (folder folderName of folder folder2Search ) as alias to end of foundItems
    end if
    -- now iterate through all the subfolders by calling yourself:
    repeat with eachFolder in (folders of folder2Search)
      my FindaFolder(folderName, eachFolder)
    end repeat
  end tell -- Finder
end FindaFolder
on run
  global foundItems
set foundItems to {}
  set startFolder to (choose folder with prompt "Please choose a folder to start the search in")
  FindAFolder("8754 My Folder", startFolder)
end run
The idea here is that given a folder name and a start point the script looks for that item in the starting folder. If found it adds it to the list of found items.
It then looks for any folder inside the startFolder and for each one it calls itself passing in each subdirectory in turn. The script takes care of keeping track of which folder you're in and will ensure that all folders are searched.
At the end of the script you'll have a list of all the folders that match the given name.

Similar Messages

  • Unable to traverse directories with Command-Up Arrow anymore

    This is a weird thing. Before going to 10.6/10.6.1, I was able to go up/down a directory level with Command-Up Arrow/Down Arrow, either in Finder or a save/load box.
    Now, it doesn't work - has the update broken it ? Or is there a way to fix it ?

    It seems to work OK on the MBP also on 10.6.1, but the iMac isn't playing ball. I'm debating whether or not to reinstall it again in case it's missing something.
    I've deleted the finder.plist to no avail except for having to set up everything again !

  • Am not able to run the java program - pls help

    1. I installed java in the below path
         c:\program files\java\jdk1.5.0
         c:\program files\java\jre1.5.0
    I set the path in
         User variable i. variable name: path
              ii. variable value: c:\program files\java\jdk1.5.0\bin
    when I compile it in command prompt-applying javac ? it performed successfully-shows
    options like ?g create all debug info, -g : new Generate no debug info etc.,
    But am not able to run the file. It shows error msg.
    2. I specified the same name for file name & class name.
    3. Java <class name>
         Exception in thread ?main?java.lang.NoclassDeffoundError: <class name>
    4. Java ?cp <class name>
         Unrecognized option: -cp.<classname>
         Could not create the Java Virtual Machine
    5. Java ?classpath . <classname>
         Exception in thread ?main?.java.lang.unsupported classversionError: <classname>
         <unsupported major.minor version 49.0
              at java.lang.classloader.defineclass0<native method>
              at java.lang.classloader.defineclass<unknown source>
                   --and many listed below?
    6. Java ?classpath c:\program files\java\jdk1.5.0\bin <class name>
         Exception in thread ?main?java.lang.NoclassDeffoundError: <class name>
    7. I re-installed the java, but still the problem continuing.
    pls help... its very urgent

    Is the java class you compiled/calling in the default package? If it is not, you will have to call it by the fully qualified name.
    e.g.
    package com.mycompany.myproject;
    public class MyClass {
        public static void main(String[] args) { }
    }This would be called as "Java com.mycompany.myproject.MyClass" and must contain a main method with signature as above.
    You would have to call this from folder where the compiled classes are located. If using package, you would call from directory at level of top most package so com folder in this example as Java will look at each package name in qualified name and try to traverse directories with those same names to get to .class file matching class name specified. To avoid this, your newly compiled .class files must also be in your classpath.
    Hopefully that helps.
    --Kevin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How do I create an object from a filename?

    I'm traversing directories and storing a list of files in a File array. Then I traverse the array looking at the extension of the file. If it is .java then I would like to instantiate it as a class so that I may pass the new object to another function which will examine its methods. I've tried Class.forName(file.getCanonicalPath()) and it throws a ClassNotFound exception. How can I create an object from a valid filename, please?

    Rick_Avlonitis wrote:
    If it is .java then I would like to </snip>.java files contain source code, they can't be "instantiated". Class.forName() takes a classname as parameter, i.e. "mypackage.MyClass". A class name is not a file name, and it doesn't have an extension. As stated in the other reply, you'll need to have the class on your class path.

  • Reading files and directory from a directory

    ublic static void readFromDirectory(String dirName) {
              // stop word ArrayLists
              ArabicStop();
              EnglishStop();
              FrenchStop();
              SpanishStop();
              DutchStop();
              File dir = new File(dirName);
              if (dir.isDirectory()) {
                   String[] child = dir.list();
                   System.out.println("hi Iam here");
                   for (int i = 0; i < child.length; i++) {
                        readFromDirectory(child.toString());
              File[] files = dir.listFiles();
              if (files == null) {
                   System.out.println("There are no files in this Directory ");
              } else {
                   for (int j = 0; j < files.length; j++) {
                        String filename = files[j].toString();
                        readFile(filename);
                   if (dirName.equalsIgnoreCase("English")
                             || dirName.equalsIgnoreCase("Nonenglish")) {
                        for (int i = 0; i < a2.size(); i++) {
                             keyWord = a2.get(i).toString();
                             //System.out.println("===" + keyWord + "===" + "KeyWord");
                             for (int a = 0; a < text.size(); a++) {
                                  String t1 = text.get(a).toString();
                                  if (keyWord.equalsIgnoreCase(t1)) {
                                       count++;
                                       //System.out.println("Found at:" + files[j] + " file");
                             keyWCount = count;
                             m1.put(keyWord, keyWCount);
                             //System.out.println(m1.get(keyWord));
                             count = 0;
                   } else if (dirName.equalsIgnoreCase("Spanish")) {
                        for (int i = 0; i < a5.size(); i++) {
                             keyWord = a5.get(i).toString();
                             //System.out.println("===" + keyWord + "===" + "KeyWord");
                             for (int a = 0; a < text.size(); a++) {
                                  String t1 = text.get(a).toString();
                                  if (keyWord.equalsIgnoreCase(t1)) {
                                       count++;
                                       //System.out.println("Found at:" + files[j] + " file");
                             keyWCount = count;
                             m1.put(keyWord, keyWCount);
                             //System.out.println(m1.get(keyWord));
                             count = 0;
                        //System.out.println(m1);
                   } else if (dirName.equalsIgnoreCase("French")) {
                        for (int i = 0; i < a3.size(); i++) {
                             keyWord = a3.get(i).toString();
                             //System.out.println("===" + keyWord + "===" + "KeyWord");
                             for (int a = 0; a < text.size(); a++) {
                                  String t1 = text.get(a).toString();
                                  if (keyWord.equalsIgnoreCase(t1)) {
                                       count++;
                                       //System.out.println("Found at:" + files[j] + " file");
                             keyWCount = count;
                             m1.put(keyWord, keyWCount);
                             //System.out.println(m1.get(keyWord));
                             count = 0;
         public static void main(String[] args) {
              int countText = 0;
              int c;
              test t1 = new test();
              System.out.println("IN NON - ENGLISH DOCUMENTS - P :");
              t1.readFromDirectory("NonEnglish");
              for (int j = 0; j < text.size(); j++) {
                   if (!text.get(j).toString().equalsIgnoreCase("")) {
                        countText++;
              c = countText;
              //System.out.println(c);
              //System.out.println(text.size());
              for (int i = 0; i < a2.size(); i++) {
                   String word = a2.get(i).toString();
                   String m = (m1.get(word)).toString();
                   double x = Double.parseDouble(m);
                   System.out.println(word + ":" + (x / c) * 100 + " %");
    I wanna read text files from directory that contain - lots of other directorys... and by using this code I have error,,,
    Can anyone help me plzzz
    Edited by: Shamma on Oct 9, 2008 3:32 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    You actually have more than 1 problem: you cannot traverse directories recursively and you get a NullPointerException.
    For the first problem you might want to verify what this statement returns:
    child.toString() (I honestly don't understand why you are calling toString() on a String object, but that's not the real problem!)
    You probably expect it to be a full absolute path.
    The NullPointerException has already been pointed out by masijade.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Finder crashes in multi-column view when clicking file

    Hello All,
    This problem occurred recently after my powerbook refused to wake from sleep mode:
    If Finder is open in multiple-column view and I select a file, Finder then disappears. I believe it has something to do w/ showing the file preview or in getting the file information. This happens w/ every file; I can still traverse directories or start programs/open files when I run Finder in icon view or single-column view.
    I tried: rm -fr /Users/jacobc/Library/Preferences/com.apple.Finder.plist which had no effect.
    *From Console.app:*
    ===== Thursday, May 15, 2008 9:53:04 AM Europe/Amsterdam =====
    2008-05-15 09:55:26.492 Finder[499] CFLog (0):
    CFPropertyListCreateFromXMLData(): plist parse failed; the data is not proper UTF-8. The file name for this data could be:
    (UNKNOWN)
    The parser will retry as in 10.2, but the problem should be corrected in the plist.
    May 15 09:55:27 fender crashdump[508]: Finder crashed
    May 15 09:55:28 fender crashdump[508]: crash report written to: /Users/jacobc/Library/Logs/CrashReporter/Finder.crash.log
    *From /Users/jacobc/Library/Logs/CrashReporter/Finder.crash.log:*
    Host Name: fender
    Date/Time: 2008-05-15 09:55:26.586 +0200
    OS Version: 10.4.11 (Build 8S165)
    Report Version: 4
    Command: Finder
    Path: /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder
    Parent: WindowServer [71]
    Version: 10.4.7 (10.4.7)
    Build Version: 1
    Project Name: Finder_FE
    Source Version: 5292900
    PID: 499
    Thread: 0
    Exception: EXCBADACCESS (0x0001)
    Codes: KERNPROTECTIONFAILURE (0x0002) at 0x00000034
    Thread 0 Crashed:
    0 com.apple.CoreFoundation 0x9080d764 CFBundleCopyLocalizedString + 124
    1 Metadata 0x910d989c MDSchemaCopyDisplayNameForAttribute + 60
    2 com.apple.finder 0x0013a358 0x1000 + 1282904
    3 com.apple.finder 0x00139d3c 0x1000 + 1281340
    4 com.apple.finder 0x001936bc 0x1000 + 1648316
    5 com.apple.finder 0x00261c34 dyldstubOpenADefaultComponent + 432452
    6 com.apple.finder 0x00261c1c dyldstubOpenADefaultComponent + 432428
    7 com.apple.finder 0x00153bc4 0x1000 + 1387460
    8 com.apple.finder 0x00153d78 0x1000 + 1387896
    9 com.apple.finder 0x000c3130 0x1000 + 794928
    10 com.apple.finder 0x000c2ab4 0x1000 + 793268
    11 com.apple.finder 0x001ab9b8 0x1000 + 1747384
    12 com.apple.finder 0x000735ec 0x1000 + 468460
    13 com.apple.finder 0x0005ba20 0x1000 + 371232
    14 com.apple.CoreFoundation 0x907f2370 __CFRunLoopDoTimer + 184
    15 com.apple.CoreFoundation 0x907dece8 __CFRunLoopRun + 1680
    16 com.apple.CoreFoundation 0x907de29c CFRunLoopRunSpecific + 268
    17 com.apple.HIToolbox 0x932aeb20 RunCurrentEventLoopInMode + 264
    18 com.apple.HIToolbox 0x932ae1b4 ReceiveNextEventCommon + 380
    19 com.apple.HIToolbox 0x932f3348 AcquireNextEventInMode + 72
    20 com.apple.HIToolbox 0x932f3138 RunApplicationEventLoop + 132
    21 com.apple.finder 0x00008960 0x1000 + 31072
    22 com.apple.finder 0x00004f18 0x1000 + 16152
    23 com.apple.finder 0x00069ff0 0x1000 + 430064
    24 com.apple.finder 0x00069e98 0x1000 + 429720
    Thread 1:
    0 libSystem.B.dylib 0x9002f08c kevent + 12
    1 com.apple.DesktopServices 0x92b09e50 TFSNotificationTask::FSNotificationTaskProc(void*) + 56
    2 ...ple.CoreServices.CarbonCore 0x90bc4794 PrivateMPEntryPoint + 76
    3 libSystem.B.dylib 0x9002bd08 pthreadbody + 96
    Thread 2:
    0 libSystem.B.dylib 0x9002c3c8 semaphorewait_signaltrap + 8
    1 libSystem.B.dylib 0x90030eac pthreadcondwait + 480
    2 ...ple.CoreServices.CarbonCore 0x90bc4984 MPWaitOnQueue + 224
    3 com.apple.DesktopServices 0x92b0a4cc TNodeSyncTask::SyncTaskProc(void*) + 116
    4 ...ple.CoreServices.CarbonCore 0x90bc4794 PrivateMPEntryPoint + 76
    5 libSystem.B.dylib 0x9002bd08 pthreadbody + 96
    Thread 0 crashed with PPC Thread State 64:
    srr0: 0x000000009080d764 srr1: 0x000000000200d030 vrsave: 0x0000000000000000
    cr: 0x44028242 xer: 0x0000000000000007 lr: 0x000000009080d764 ctr: 0x00000000907c6d08
    r0: 0x000000009080d74c r1: 0x00000000bfffede0 r2: 0x0000000000000040 r3: 0x0000000000000034
    r4: 0x000000009086ecec r5: 0x0000000000000000 r6: 0x00000000910f9780 r7: 0x00000000a07c0e44
    r8: 0x00000000000007c8 r9: 0x0000000000000007 r10: 0x00000000a10d7b48 r11: 0x00000000000007c8
    r12: 0x00000000907c6d08 r13: 0x0000000000000000 r14: 0x0000000000000001 r15: 0x0000000000000000
    r16: 0x0000000000000000 r17: 0x0000000000000000 r18: 0x0000000000000000 r19: 0x0000000000000000
    r20: 0x000000007fffffff r21: 0x00000000ffffffff r22: 0x0000000000607a98 r23: 0x0000000000000000
    r24: 0x00000000a10d6d9c r25: 0x00000000006eda30 r26: 0x00000000a10d7b48 r27: 0x0000000000000000
    r28: 0x00000000006edb1c r29: 0x00000000bfffefb0 r30: 0x0000000000000000 r31: 0x000000009080d6f8
    Binary Images Description:
    0x1000 - 0x31dfff com.apple.finder 10.4.7 /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder
    0x5f9000 - 0x5fbfff com.apple.textencoding.unicode 2.0 /System/Library/TextEncodings/Unicode Encodings.bundle/Contents/MacOS/Unicode Encodings
    0x5fc1000 - 0x6029fff com.DivXInc.DivXDecoder 6.2.5 /Library/QuickTime/DivX Decoder.component/Contents/MacOS/DivX Decoder
    0x6036000 - 0x60d7fff com.apple.QuickTimeImporters.component 7.4.5 (67) /System/Library/QuickTime/QuickTimeImporters.component/Contents/MacOS/QuickTime Importers
    0x60fd000 - 0x6176fff com.DivXInc.DivXDecoder 6.0.5 /Library/QuickTime/DivX 6 Decoder.component/Contents/MacOS/DivX 6 Decoder
    0x8fe00000 - 0x8fe52fff dyld 46.16 /usr/lib/dyld
    0x90000000 - 0x901bcfff libSystem.B.dylib /usr/lib/libSystem.B.dylib
    0x90214000 - 0x90219fff libmathCommon.A.dylib /usr/lib/system/libmathCommon.A.dylib
    0x9021b000 - 0x90268fff com.apple.CoreText 1.0.4 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreText.framework/Versions/A/CoreText
    0x90293000 - 0x90344fff ATS /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ATS.framework/Versions/A/ATS
    0x90373000 - 0x9072efff com.apple.CoreGraphics 1.258.77 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/CoreGraphics
    0x907bb000 - 0x90895fff com.apple.CoreFoundation 6.4.10 (368.33) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x908de000 - 0x908defff com.apple.CoreServices 10.4 (???) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
    0x908e0000 - 0x909e2fff libicucore.A.dylib /usr/lib/libicucore.A.dylib
    0x90a3c000 - 0x90ac0fff libobjc.A.dylib /usr/lib/libobjc.A.dylib
    0x90aea000 - 0x90b5afff com.apple.framework.IOKit 1.4 (???) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    0x90b70000 - 0x90b82fff libauto.dylib /usr/lib/libauto.dylib
    0x90b89000 - 0x90e60fff com.apple.CoreServices.CarbonCore 681.17 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonC ore.framework/Versions/A/CarbonCore
    0x90ec6000 - 0x90f46fff com.apple.CoreServices.OSServices 4.1 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServi ces.framework/Versions/A/OSServices
    0x90f90000 - 0x90fd2fff com.apple.CFNetwork 4.0 (129.23) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwo rk.framework/Versions/A/CFNetwork
    0x90fe7000 - 0x90ffffff com.apple.WebServices 1.1.2 (1.1.0) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/WebServ icesCore.framework/Versions/A/WebServicesCore
    0x9100f000 - 0x91090fff com.apple.SearchKit 1.0.7 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchK it.framework/Versions/A/SearchKit
    0x910d6000 - 0x91100fff Metadata /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadat a.framework/Versions/A/Metadata
    0x91111000 - 0x9111ffff libz.1.dylib /usr/lib/libz.1.dylib
    0x91122000 - 0x912ddfff com.apple.security 4.6 (29770) /System/Library/Frameworks/Security.framework/Versions/A/Security
    0x913dc000 - 0x913e5fff com.apple.DiskArbitration 2.1.2 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
    0x913ec000 - 0x913f4fff libbsm.dylib /usr/lib/libbsm.dylib
    0x913f8000 - 0x91420fff com.apple.SystemConfiguration 1.8.3 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfi guration
    0x91433000 - 0x9143efff libgcc_s.1.dylib /usr/lib/libgcc_s.1.dylib
    0x91443000 - 0x914befff com.apple.audio.CoreAudio 3.0.5 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
    0x914fb000 - 0x914fbfff com.apple.ApplicationServices 10.4 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Application Services
    0x914fd000 - 0x91535fff com.apple.AE 1.5 (297) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ AE.framework/Versions/A/AE
    0x91550000 - 0x91622fff com.apple.ColorSync 4.4.10 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ColorSync.framework/Versions/A/ColorSync
    0x91675000 - 0x91706fff com.apple.print.framework.PrintCore 4.6 (177.13) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ PrintCore.framework/Versions/A/PrintCore
    0x9174d000 - 0x91804fff com.apple.QD 3.10.25 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ QD.framework/Versions/A/QD
    0x91841000 - 0x9189ffff com.apple.HIServices 1.5.3 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ HIServices.framework/Versions/A/HIServices
    0x918ce000 - 0x918f2fff com.apple.LangAnalysis 1.6.1 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ LangAnalysis.framework/Versions/A/LangAnalysis
    0x91906000 - 0x9192bfff com.apple.FindByContent 1.5 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ FindByContent.framework/Versions/A/FindByContent
    0x9193e000 - 0x91980fff com.apple.LaunchServices 182 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ LaunchServices.framework/Versions/A/LaunchServices
    0x9199c000 - 0x919b0fff com.apple.speech.synthesis.framework 3.3 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ SpeechSynthesis.framework/Versions/A/SpeechSynthesis
    0x919be000 - 0x91a04fff com.apple.ImageIO.framework 1.5.6 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/ImageIO
    0x91a1b000 - 0x91ae2fff libcrypto.0.9.7.dylib /usr/lib/libcrypto.0.9.7.dylib
    0x91b30000 - 0x91b45fff libcups.2.dylib /usr/lib/libcups.2.dylib
    0x91b4a000 - 0x91b68fff libJPEG.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libJPEG.dylib
    0x91b6e000 - 0x91c25fff libJP2.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libJP2.dylib
    0x91c74000 - 0x91c78fff libGIF.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libGIF.dylib
    0x91c7a000 - 0x91ce4fff libRaw.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libRaw.dylib
    0x91ce9000 - 0x91d26fff libTIFF.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libTIFF.dylib
    0x91d2d000 - 0x91d47fff libPng.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libPng.dylib
    0x91d4c000 - 0x91d4ffff libRadiance.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libRadiance.dylib
    0x91d51000 - 0x91e3ffff libxml2.2.dylib /usr/lib/libxml2.2.dylib
    0x91e5e000 - 0x91e5efff com.apple.Accelerate 1.2.2 (Accelerate 1.2.2) /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
    0x91e60000 - 0x91f45fff com.apple.vImage 2.4 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.fr amework/Versions/A/vImage
    0x91f4d000 - 0x91f6cfff com.apple.Accelerate.vecLib 3.2.2 (vecLib 3.2.2) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/vecLib
    0x91fd8000 - 0x92046fff libvMisc.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libvMisc.dylib
    0x92051000 - 0x920e6fff libvDSP.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libvDSP.dylib
    0x92100000 - 0x92688fff libBLAS.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libBLAS.dylib
    0x926bb000 - 0x929e6fff libLAPACK.dylib /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libLAPACK.dylib
    0x92a16000 - 0x92b04fff libiconv.2.dylib /usr/lib/libiconv.2.dylib
    0x92b07000 - 0x92b8ffff com.apple.DesktopServices 1.3.7 /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/Desk topServicesPriv
    0x92bd0000 - 0x92dfbfff com.apple.Foundation 6.4.10 (567.37) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
    0x92f28000 - 0x92f46fff libGL.dylib /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
    0x92f51000 - 0x92fabfff libGLU.dylib /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
    0x92fc9000 - 0x92fc9fff com.apple.Carbon 10.4 (???) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
    0x92fcb000 - 0x92fdffff com.apple.ImageCapture 3.0 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture. framework/Versions/A/ImageCapture
    0x92ff7000 - 0x93007fff com.apple.speech.recognition.framework 3.4 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecogni tion.framework/Versions/A/SpeechRecognition
    0x93013000 - 0x93028fff com.apple.securityhi 2.0 (203) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.fr amework/Versions/A/SecurityHI
    0x9303a000 - 0x930c1fff com.apple.ink.framework 101.2 (69) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework /Versions/A/Ink
    0x930d5000 - 0x930e0fff com.apple.help 1.0.3 (32) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framewor k/Versions/A/Help
    0x930ea000 - 0x93117fff com.apple.openscripting 1.2.5 (???) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting .framework/Versions/A/OpenScripting
    0x93131000 - 0x93141fff com.apple.print.framework.Print 5.0 (190.1) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framewo rk/Versions/A/Print
    0x9314d000 - 0x931b3fff com.apple.htmlrendering 1.1.2 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HTMLRendering .framework/Versions/A/HTMLRendering
    0x931e4000 - 0x93233fff com.apple.NavigationServices 3.4.4 (3.4.3) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/NavigationSer vices.framework/Versions/A/NavigationServices
    0x93261000 - 0x9327efff com.apple.audio.SoundManager 3.9 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.f ramework/Versions/A/CarbonSound
    0x93290000 - 0x9329dfff com.apple.CommonPanels 1.2.2 (73) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels. framework/Versions/A/CommonPanels
    0x932a6000 - 0x935b4fff com.apple.HIToolbox 1.4.10 (???) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.fra mework/Versions/A/HIToolbox
    0x93704000 - 0x93710fff com.apple.opengl 1.4.7 /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
    0x94217000 - 0x942dcfff com.apple.audio.toolbox.AudioToolbox 1.4.7 /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
    0x9432f000 - 0x9432ffff com.apple.audio.units.AudioUnit 1.4 /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
    0x94331000 - 0x944f1fff com.apple.QuartzCore 1.4.12 /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
    0x94580000 - 0x945d0fff libGLImage.dylib /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dyl ib
    0x945d9000 - 0x945f3fff com.apple.CoreVideo 1.4.2 /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
    0x94604000 - 0x94624fff libmx.A.dylib /usr/lib/libmx.A.dylib
    0x94661000 - 0x946a6fff com.apple.bom 8.5 (86.3) /System/Library/PrivateFrameworks/Bom.framework/Versions/A/Bom
    0x947c7000 - 0x947d6fff libCGATS.A.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/Resources/libCGATS.A.dylib
    0x947de000 - 0x947eafff libCSync.A.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/Resources/libCSync.A.dylib
    0x94830000 - 0x94848fff libRIP.A.dylib /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/Resources/libRIP.A.dylib
    0x9484f000 - 0x94b79fff com.apple.QuickTime 7.4.5 (67) /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime
    0x94c60000 - 0x94cd1fff libstdc++.6.dylib /usr/lib/libstdc++.6.dylib
    0x94fff000 - 0x95005fff com.apple.filesync 3.0.4 (99.8) /System/Library/PrivateFrameworks/FileSync.framework/Versions/A/FileSync
    0x97bd9000 - 0x97bf8fff com.apple.vecLib 3.2.2 (vecLib 3.2.2) /System/Library/Frameworks/vecLib.framework/Versions/A/vecLib
    0x983fe000 - 0x9840bfff com.apple.agl 2.5.6 (AGL-2.5.6) /System/Library/Frameworks/AGL.framework/Versions/A/AGL
    0x99f23000 - 0x9ad33fff com.apple.QuickTimeComponents.component 7.4.5 (67) /System/Library/QuickTime/QuickTimeComponents.component/Contents/MacOS/QuickTim eComponents

    Hello BDAqua,
    *Thank-you for your reply. I did Verify/Repair HD Perms and I tried rebuilding the LaunchServices db which produced the following output:*
    fender:~ root# /System/Library/Frameworks/ApplicationServices.framework/\
    Frameworks/LaunchServices.framework/Support/lsregister \
    -kill -r -domain local -domain system -domain user
    2008-05-15 14:16:34.902 lsregister[360] CFLog (0):
    CFPropertyListCreateFromXMLData(): plist parse failed; the data is not proper UTF-8. The file name for this data could be:
    Contents/Info.plist -- file://localhost/System/Library/Spotlight/Application.mdimporter/
    The parser will retry as in 10.2, but the problem should be corrected in the plist.
    2008-05-15 14:16:34.999 lsregister[360] CFLog (0):
    CFPropertyListCreateFromXMLData(): plist parse failed; the data is not proper UTF-8. The file name for this data could be:
    Contents/Info.plist -- file://localhost/System/Library/Spotlight/Image.mdimporter/
    The parser will retry as in 10.2, but the problem should be corrected in the plist.
    *I also get similar plist errors when I try to connect to another machine w/ ssh on the commandline. Should I be gathering info on what 'plist' is/does? Or perhaps focusing in on Spotlight?*
    *In addition to "Verify/Repair Disk Permissions", I also ran "Verify Disk" which produced the following:*
    Verifying volume “Piece of the Action”
    Checking HFS Plus volume.
    Checking Extents Overflow file.
    Checking Catalog file.
    Checking multi-linked files.
    Checking Catalog hierarchy.
    Checking Extended Attributes file.
    Overlapped extent allocation (file 27746 /System/Library/Spotlight/Audio.mdimporter/Contents/Info.plist)
    27746 /System/Library/Spotlight/Audio.mdimporter/Contents/Info.plist
    %@)",1)
    46774 /usr/sbin/sendmail
    Overlapped extent allocation (file 202481 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ LaunchServices.framework/Versions/A/Resources/Italian.lproj/Localized.strings)
    Overlapped extent allocation (file 211340 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ LaunchServices.framework/Versions/A/Resources/Dutch.lproj/Localized.strings)
    Overlapped extent allocation (file Overlapped extent allocation (file stem/Library/Spotlight/iPhoto.mdimporter/Contents/Info.plist)
    Overlapped extent allocation (file 795359 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadat a.framework/Versions/A/Resources/schema.xml)
    Overlapped extent allocation (file 925283 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadat a.framework/Versions/A/Resources/Info.plist)
    Overlapped extent allocation (file Overlapped extent allocation (file t/iCal/Sources/C8222BA7-39CF-4ABC-B619-1E055A0B4271.calendar/corestorage.ics)
    Overlapped extent allocation (file 2317978 /Applications/Firefox.app/Contents/MacOS/greprefs/xpinstall.js)
    Overlapped extent allocation (file 2700229 /Users/jacobc/Library/Application Support/iCal/Sources/3B9F64D7-4E0B-4453-A766-6F508A5C8E6A.calendar/corestorage. ics)
    Overlapped extent allocation (file Overlapped extent allocation (file .app/Contents/Info.plist)
    Overlapped extent allocation (file 4825349 /Library/Google/Google Updater/Google Updater.app/Contents/Info.plist)
    Overlapped extent allocation (file 5205635 /Users/jacobc/Library/Application Support/iCal/Sources/C8222BA7-39CF-4ABC-B619-1E055A0B4271.calendar/Info.plist)
    Overlapped extent allocation (file 5205640 /Users/jacobc/Library/Application Support/iCal/Sources/F5DC0046-5D48-4E22-9A28-976879F51096.calendar/Info.plist)
    5205640 /Users/jacobc/Library/Application Support/iCal/Sources/F5DC0046-5D48-4E22-9A28-976879F51096.calendar/Info.plist
    cation (file %@)",1)
    5205642 /Users/jacobc/Library/Application Support/iCal/Sources/216D55EA-00AD-4252-8716-C5C687C5AEDA.calendar/Info.plist
    Overlapped extent allocation (file 5890727 /Users/jacobc/Library/Application Support/Firefox/Profiles/42oexbuf.default/extensions/{3f1182ea-3243-4d32-8826-7 1fb1cc9c328}/locale/en-US/overlay.dtd)
    Overlapped extent allocation (file 9657861 /private/var/vm/appprofile/5cnames)
    Checking volume bitmap.
    Checking volume bitmap.
    0)
    Checking volume information.
    Volume Header needs minor repair
    The volume Piece of the Action needs to be repaired.
    Error: The underlying task reported failure on exit
    1 HFS volume checked
    Volume needs repair

  • BrowseBar2 Upgrade? (allows you to enter directory path in Bridge)

    I've been using the handy BrowseBar2 extension for Bridge but it doesn't work with CS6. Does anyone know if there are plans to upgrade it? Or what it would take to do the upgrade? Is the source code available?
    I'm finding it inconvenient to have to manually traverse directories one level at a time again. I often have the needed directory open in Windows Explorer and used to like being able to just copy/paste the path into Bridge.
    David Salahi
    http://photoperformance.org/

    You can do this in Bridge CS6 without installing any script. Just click on the path at the top and it changes so that you can edit or paste into it.

  • Intel Imac Tiger 10.4 boot issue/USB Boot

    Intel 20 inch Imac had been CLEAN install Tiger 10.4 from
    Grey Original install disks. ALL hardware and O/S working perfectly fine.
    Tried to upgrade to Leopard 10.5 but after startup the installer does a "data integrity check"
    and reported a " dirty/defective " spot on the Leopard dvd disk and then it  offered selection
    to restore/reboot back to the original Tiger 10.4 O/S.
    The Installer script/process failed and somehow screwed up the boot process.
    The leopard disk would not eject. (I have since manually removed it and destroyed it as defective).
    What I get now on boot up is the boot tone grey-white screen then the apple shows up then I get
    a black screen with the following error message:
    localhost:/ root# CSRHIDTransitionDriver::stop
    IOBluetoothHCIControler::start Idle Timer Stopped
    At this point I hit Enter key and get the following standard root prompt:
    localhost:/ root#
    I can traverse directories and list files ( cd dirname ),( ls -al) and the original clean Tiger 10.4 instalation
    seems to be present and largly intact.
    Many commandline commands work but many do not issuing an error like path/image not found.
    " info diskutil " displays man page for diskutil.  ctrl c exits the man page.
    " diskutil list " returns the following:
    dyld: Library not loaded: /System/Library/Frameworks/CoreServices.framework/Versions/R/Frameworks/WebServ icesCore.framework/Versions/R/WebServicesCore
      Referenced from: /System/Library/Frameworks/CoreServices/.frameword/Versions/R//CoreServices
      Reason: image not found
    Trace/BPT trap
    I have tried ALL the usual boot up keypresses that should invoke boot selection menus and other
    such utilities but none of these work.
    I need some kind of manual command/script/other process to repair the boot process or to FORCE
    a boot to an external USB dvd drive from which I have the Tiger install disk so that
    I may format the hard disk and redo a clean Tiger 10.4 install.
    If there are any mac/BSD/Linux command line gurus in Long Island, NY area
    I would be happy to demonstrate this most agrevating  issue at the site.
    Tnx for your help
    Alfred
    631-928-2424
    billing -AT- adayton _dot_ com

    check the knowledgebase. I believe you need to "zap" the PRAM. I had this problem with a macbook and whatever's in the kb solved it permanently.

  • Migrating from itunes on windows to itunes on a MAC

    Hi,
    I currently have about 110 Gbytes of disk space assigned to iTunes on a windoze XP system. I'd like to move over to using a G5 that i've just bought.
    What's the best way of doing it?
    This is what I've tried so far:-
    1). Set up an NFS mount between the windows machine and the G5
    2). Created a new itunes setup on the G5
    3). Tried to add to the library on the G5 by specifying the nfs mount point.
    While I can get to the directory, i get an error message saying that it cannot find a library.xml file ( or itunes library.xml file, can't remember which)
    Next attempt was to create a temporary directory on the G% and perform a copy that traverses directories from the NFS mount point (/mnt/shared/xp_itunes) to a temporary directory.
    Problem here was that when i riped off my CDs into the windows version of iTunes, there were a lot of album or track names with non ASCII characters. When you try and use the cp command, it bleats about them and skips the copy.
    Next attempt was to use tar to generate a single (tar) file with the whole directory structure in there. It doesn't like the non standard characters either.
    While i could back up itunes to 11 DBDs or so and then try and then restore them onto the G5, is there another way?
    TIA
    Alex
    G5 quad core,mac mini   Mac OS X (10.4.10)  

    fixed it myself.
    nfs mounted the windows disk directory and managed to import the music.

  • [Solved] NFS write problem

    I looked through available threads and couldn't find anything that helped, I use VMware to develop on I need to connect to the vm filesystem with local dev tools. I set up everything according to arch wiki, caveat the server vm is ubuntu. I can mount using either the Ubuntu command
    mount -t nfs4 -o proto=tcp,port=2049 192.168.1.96:/ /root/www
    or the Arch command
    #mount -t nfs4 192.168.1.96:/ /root/www
    I can read and traverse directories, I can create a file, but I cannot edit or delete a file that is already there.
    Ubuntu fstab
    # /etc/fstab: static file system information.
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    # <file system> <mount point> <type> <options> <dump> <pass>
    proc /proc proc nodev,noexec,nosuid 0 0
    # / was on /dev/sda1 during installation
    UUID=24e3b6ef-d2bc-4ff9-891c-411910f7ce24 / ext4 errors=remount-ro 0 1
    # swap was on /dev/sda5 during installation
    UUID=ee28c56a-6aaa-4861-9778-fb3f335dba0c none swap sw 0 0
    /dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
    /var/www /export/www none bind,rw 0 0
    I have to run the mount once the vm is up so nothing in my fstab.
    client /etc/conf.d/nfs-common.conf
    # Parameters to be passed to nfs-common (nfs clients & server) init script.
    # If you do not set values for the NEED_ options, they will be attempted
    # autodetected; this should be sufficient for most people. Valid alternatives
    # for the NEED_ options are "yes" and "no".
    # Do you want to start the statd daemon? It is not needed for NFSv4.
    NEED_STATD=""
    # Options to pass to rpc.statd.
    # See rpc.statd(8) for more details.
    # N.B. statd normally runs on both client and server, and run-time
    # options should be specified accordingly.
    # STATD_OPTS="-p 32765 -o 32766"
    STATD_OPTS=""
    # Options to pass to sm-notify
    # e.g. SMNOTIFY_OPTS="-p 32764"
    SMNOTIFY_OPTS=""
    # Do you want to start the idmapd daemon? It is only needed for NFSv4.
    NEED_IDMAPD=""
    # Options to pass to rpc.idmapd.
    # See rpc.idmapd(8) for more details.
    IDMAPD_OPTS=""
    # Do you want to start the gssd daemon? It is required for Kerberos mounts.
    NEED_GSSD=""
    # Options to pass to rpc.gssd.
    # See rpc.gssd(8) for more details.
    GSSD_OPTS=""
    # Where to mount rpc_pipefs filesystem; the default is "/var/lib/nfs/rpc_pipefs".
    PIPEFS_MOUNTPOINT=""
    # Options used to mount rpc_pipefs filesystem; the default is "defaults".
    PIPEFS_MOUNTOPTS=""
    Here is the /etc/exports from Ubuntu
    /export 192.168.1.0/24(rw,fsid=0,insecure,no_subtree_check,async)
    /export/www 192.168.1.0/24(rw,nohide,insecure,no_subtree_check,async)
    Ubuntu nfs-kernel-server
    # Number of servers to start up
    # To disable nfsv4 on the server, specify '--no-nfs-version 4' here
    RPCNFSDCOUNT=8
    # Runtime priority of server (see nice(1))
    RPCNFSDPRIORITY=0
    # Options for rpc.mountd.
    # If you have a port-based firewall, you might want to set up
    # a fixed port here using the --port option. For more information,
    # see rpc.mountd(8) or http://wiki.debian.org/SecuringNFS
    RPCMOUNTDOPTS=--manage-gids
    # Do you want to start the svcgssd daemon? It is only required for Kerberos
    # exports. Valid alternatives are "yes" and "no"; the default is "no".
    NEED_SVCGSSD=no # no is default
    # Options for rpc.svcgssd.
    RPCSVCGSSDOPTS=
    # Options for rpc.nfsd.
    RPCNFSDOPTS=
    Ubuntu /etc/default/nfs-common
    # If you do not set values for the NEED_ options, they will be attempted
    # autodetected; this should be sufficient for most people. Valid alternatives
    # for the NEED_ options are "yes" and "no".
    # Do you want to start the statd daemon? It is not needed for NFSv4.
    NEED_STATD=
    # Options for rpc.statd.
    # Should rpc.statd listen on a specific port? This is especially useful
    # when you have a port-based firewall. To use a fixed port, set this
    # this variable to a statd argument like: "--port 4000 --outgoing-port 4001".
    # For more information, see rpc.statd(8) or http://wiki.debian.org/SecuringNFS
    STATDOPTS=
    # Do you want to start the idmapd daemon? It is only needed for NFSv4.
    NEED_IDMAPD=yes
    # Do you want to start the gssd daemon? It is required for Kerberos mounts.
    NEED_GSSD=no # no is default
    I appreciate any help you can give thanks
    --jerry
    Last edited by jk121960 (2012-03-22 19:03:07)

    Basically, I have had very few problems with NFS - however, the ubuntu-version of linuxmint had problems with uid/gids - they ended up as the complement of '-2'!
    I never use an exports file, but set up the server in rc.local, basically like so:
    exportfs -iv -o rw,insecure,no_root_squash /pub/usb 192.168.1.0/24:/pub
    Then, on the client side in /etc/fstab I have:
    {servername}:/pub /pub nfs defaults,noatime,noauto 0 0
    With linuxmint (at least the gnome-version), I had to use 'sshfs' instead. linuxmint lmde is ok.
    Also - I have used NFS for more years than I care to remember, but ... I must admit that sshfs has its merits - especially if you remember to use '-o allow_other'.
    ie on the client side you can use:
    sshfs -o allow_other {servername}:/pub/usb /pub
    Hope this helps.
    Last edited by perbh (2012-03-22 18:12:05)

  • Traversing files and directories underneath a directory

    I'm looking at some sample code about traversing files and directories underneath a directory. I'm trying to understand exactly what the code is doing. I see that dir.list() is building a string array of filenames and directory names. Then it tests each to see whether it's a directory. If it's a directory then is looks and each file and or directory in that directory.
    But I don't understand how it keeps going below just the second level directory. The two lines of code I'm not sure I understand are:
    1) process(dir);
    2) visitAllDirsAndFiles(new File(dir, children));
    Can anyone help me to understand exactly how this code block can traverse beyond just the second directory level?
    // Process all files and directories under dir
        public static void visitAllDirsAndFiles(File dir) {
            process(dir);
            if (dir.isDirectory()) {
                String[] children = dir.list();
                for (int i=0; i<children.length; i++) {
                    visitAllDirsAndFiles(new File(dir, children));

    No, I guess they might be assuming somethings. Here is the page with the sample code:
    [http://exampledepot.com/egs/java.io/TraverseTree.html]

  • Traversing all directories and listing all file objects

    Hi
    I am wondering if someone can help me out.
    In IFS, I would like to traverse recursively down all directories starting from a particular directory to be set by me, and collect all objects that are file objects, say in an Array of PublicObjects. However the listing should exclude folder objects. Obviously the folder objects would be used to traverse further down the directory tree and collect more (file) PublicObjects.
    I have tried a few things but I can't seem to distinguish between folder and file objects. If someone could provide me with a code example to get me started that would be tremendously appreciated.
    Thanks very much.
    Hugo

    Can you not just test for an instance of Folder?

  • Reading files from 10000 sub directories

    I have to recursively read files from 10000 subdirectories. Each subdirectory might have 1000+ files. What would be the best way to read directories recursively ? Is there anything better than calling listFiles and then checking if it's a directory. I am planning to read 1000 files during one cycle.

    Your hierarchy structure is nothing but a tree.
    For example take this strucutre:
    A
    B C
    F G D E
    Each node is a directory and the leaf node is file.
    You can use Post Order Traversal. That is Left-Right-Root. You can select any traversal technique. All you have to do is check that each element you are currently handling is a leaf node or not.

  • Read files from multiple directories

    Hy to all! I have a little problem with reading files from a hierarchy of directories,something like this: directory A contains: 4 filed and directory B, and also B contains 3 files and 2 directories and so on. i want to make a method that reads all the files from directory A (including all files from subdirectory). I know i have to use recursive programming, i need a method that will be use to do this. Can U help me to do this????? Thank you all.

    Can U help me to do this?Sure. First, review basic File IO in Java: [http://java.sun.com/docs/books/tutorial/essential/io/file.html]
    Second, have a look at the numerous examples available on the Internet: [http://www.google.com/search?q=java+traverse+directory]
    Third, let us know if you run into any specific problems.
    Good luck!

  • Directory Traversal and Empty Directory Issue. Please Help!

    Hi
    I am building an application which is aimed at traversing the entire hard disk or a given folder and extract files from the folder, sub-folders and so on. I am able to currently traverse the disk and able to gain access to the files which are nested several layers of directories. The issue I am facing is that when I reach an empty directory, it throws a NullPointerException. I have tried using all kinds of methods like dir.exists() and have also tried to check for whether the number files in the directory is > 0, but the exception is still bugging me. I would require any help I can get.
    Here is the code:
    public class myFileReader{
        void myRecursiveMethod(File dir) {
            File eachFile;
            File[] files = dir.listFiles();
            for (int i = 0;i < files.length; i++) {
                if (files.isDirectory()) {
    if (files[i].list().length > 0) { // I am not sure if this is the right way to go about it. This is one of the ways I tried.
    eachFile = (File)files[i];
    myRecursiveMethod(eachFile);
    System.out.println("Directory: " + eachFile);
    } else if (files[i].isFile()) {
    System.out.println("Files: " + files[i]);
    public static void main(String[]args) throws Exception {
    File dir = new File("C://");
    myFileReader mfr = new myFileReader();
    mfr.myRecursiveMethod(dir);
    Hope to get some responses soon.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    kajbj wrote:
    One line throws the exception, and why aren't you checking what list() returns? It can return null.
    and the whole of this
                  if (files.list().length > 0) { // I am not sure if this is the right way to go about it. This is one of the ways I tried.
    eachFile = (File)files[i];
    myRecursiveMethod(eachFile);
    System.out.println("Directory: " + eachFile);
    } can be replaced by myRecursiveMethod(files[i]);
    System.out.println("Directory: " + files[i]);
    Edited by: sabre150 on May 23, 2009 8:49 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • What's the Maximum Action Items that can be added in the bottom bar

    Hi Experts I am very new to Fiori. I am designing UI for my app and i realized that i have 5 Action Items. As I know that the Action Items can only be added to the bottom bar(ex Approve,Accept,Reject) according to design guidelines for fiori. Can som

  • Problem with vmargs at ARGS property in imqbrokerd.conf

    Hi @ all, I'm currently testing Sun Message Queue and would like to give the Queue a little bit more of memory. I read the docs and tried to set the vmargs parameter at the ARGS property in the imqbrokerd.conf. But when I try to start the Queue I get

  • Re: More than one planned order on same day

    Dear All, I am getting more than one planned order for the same day in MD04 after I run MRP run. My requirement is that the planned order should get clubbed. My lot size is WB & 2: collective requirement setting. Please advice. Regards, Vivek Sharma

  • Company Code not productive

    While going through the system settings, I found that certain company codes are not having the status 'Company code not productive'.  These company codes are in operation.  I know that a company code in operation should be made productive so that pro

  • Import bookmarks from chrome to iPad 2?

    is there a way to do this? I've got IE, but now need chrome. Thanks