How can I get the directory(or folder) name?

Hello. I want to get directory name using Labwindows CVI. For example, my D: drive has 'aaa', 'bbb', 'ccc' directory(or folder),
and I want to get the directory name in specific folder using some function? Is there any function knowing the dirctory name?

Yes !
Thanks,  it worked !
Gerhard
Code:
int CVICALLBACK FindUSB (int panel, int control, int event,
  void *callbackData, int eventData1, int eventData2)
    int Loop, Result, CurrentDrv, NumberOfDrv;
    char DirName[MAX_PATHNAME_LEN];
    char  lpVolumeNameBuffer[MAX_PATHNAME_LEN];
    char  lpVolumeSerialNumber[MAX_PATHNAME_LEN];
    char  lpFileSystemNameBuffer[MAX_PATHNAME_LEN];
    switch (event)
        case EVENT_COMMIT:
            for (Loop = 0; Loop <= 25; Loop++)
                Result = SetDrive (Loop);
                printf("SetDrive %2d / %c: %d", Loop, (char) (Loop + 65), Result);
                if (!Result)
                    Result = GetDrive (&CurrentDrv, &NumberOfDrv);
                    printf("   GetDrive %c: %d  %d", (char) (CurrentDrv + 65), NumberOfDrv,  Result);
                    Result = GetDir (DirName);
                    if (!Result)
                        printf("   Dir: %s", DirName);
                        GetVolumeInformation(    NULL,                                // lpRootPathName,         
                                                                lpVolumeNameBuffer,        // lpVolumeNameBuffer,     
                                                                300,                                 // nVolumeNameSize,        
                                                                NULL,                               // lpVolumeSerialNumber,   
                                                                NULL,                               // lpMaximumComponentLength
                                                                NULL,                               // lpFileSystemFlags,      
                                                                lpFileSystemNameBuffer,  // lpFileSystemNameBuffer, 
                                                                300);                              // nFileSystemNameSize)
                        printf("   VolumeName: %s", lpVolumeNameBuffer);
                printf("\n");
         break;
    return 0;

Similar Messages

  • I lost all of my artist names and album names for my iTunes library. They are all now on one album. How can I get the album and artist names back?

    I lost all of my artist names and album names for my iTunes library. They are all now on one album. How can I get the album and artist names back?

    I have a script called ExportImport for this task, but it only runs in Windows.
    In principle something similar should be possible in AppleScript, but I don't currently have access to a Mac to write it myself.
    tt2

  • How can I get the directory.xml file for WL6.0?

    I have installed the ALBPM Enterprise WL6.01 and started it in my server.But I get the error message when I login.
    directory configuration runtime fails to initilize with
    resource:/Aqualogic/j2eewl/tomcate/webapps/../../webapps/webconsole/WEB-INF/directory.xml
    How can I get the XML file?

    aaa, ok i misunderstood your first post, i thought you are talking about unable to use the directory.xml from your application.
    Ok, well the directory.xml file that ALBPM uses is allways in /albpm6.0/j2eewl/conf/directory.xml if we are not talking about Standalone. And when you start your albpm server it picks up the directory.xml file from there. But it picks him up only when you start it...so if you made any changes to it, you have to restart the server.
    You should check the instalation folder of your ALBPM.
    If you want to change the user/pass in the directory.xml change it in that folder and restart ALBPM.
    If you don't know how to enter new password you have to use this sintax:
    <encrypt>newPassword</encrypt>
    Because if you open the xml file you have only <encrypted> tags, and you can't change those.
    I don't know what the xml file is doing in that tomcat folder though...maybe it get's copied to that location when you start the albpm WL
    Hope this helps
    Edited by Lex_ at 12/13/2007 10:27 PM

  • How can i get the directory of some pictures?

    I have the following class and the directory images in the same folder as this class. the problem is that i don't see the icons and i don't know how it works.
    please help. thanx a lot
    public class MyIcons {
    private final static String images = "images/";
    private final static String directory = getDirectory();
    public final static ImageIcon SAVE_FILE =
         new ImageIcon(directory + "savefile.gif");
    // not sure how to get the directory
    public static String getDirectory() {
    return ?????;
    }

    there are some programmes available in www.globalleafs.com, you can download them over there. it will be helpful

  • How can i get the directory of some files?

    I have the following class and the directory images in the same folder as this class. the problem is that i don't see the icons and i don't know how it works.
    please help. thanx a lot
    public class MyIcons {
    private final static String images = "images/";
    private final static String directory = getDirectory();
    public final static ImageIcon SAVE_FILE =
    new ImageIcon(directory + "savefile.gif");
    // not sure how to get the directory
    public static String getDirectory() {
    return ?????;
    }

    Try following code:
    import java.net.URL;
    public class MyIcons {
    private static final String images = "images/";
    private ImageIcon saveFile;
    public static void loadImage(){
    URL resourceURL = null;
    resourceURL = this.getClass().getResource(images
    + "savefile.gif");
    saveFile = new ImageIcon(resourceURL);
    }

  • How can I get the directory a program is running in?

    Hello again!
    Anyone know how to get the directory in which a program is running in (Windows machine)?

    To get the directory your java app is running in use System.getProperty("user.dir")Cheers, HJK

  • Using Mail as backup for Gmail: how can I get the Sent email folder?

    Just got this email.
    I have removed all the links etc, Posting it for info
    I have opened a Mail account and its loading up the Gmail, but there is nothing in the Sent box.
    Will they come over eventually and if so whewre?. there is 5Gb to transfer
    Thanks.
    We have recieved your request to close the email address: [which I deleted ].
    Kindly note that your request is being processed and your account information will be removed  from our servers within 48hrs after this message is read 
    If you did not make this request or recieved it in error and you wish to keep using your account and gmail services,  kindly indicate this by using  the link below
    I choose to keep my account and cancel termination request
    If you have chosen to keep your account, follow the step in the link above and the termination request will be cancelled.
    However, if you still want to terminate your account, no further action is required from you.
    Mail Administrative Dept   .
    Gmail.com

    I don't quite understand what you've posted. Have you cancelled your Gmail account?
    If you've just connected Mail to Gmail, and you've used IMAP to connect to it, you'll probably have an "All Mail" mailbox towards the bottom left of the screen (under the GMail mailbox). In there should be a Sent Mail box. All your Sent mail should be in there. To have it appear in the Sent mailbox at the top left of your screen, highlight Gmail's Sent Mail mailbox, click the Mailbox menu at the very top of your screen, and click "Use this Mailbox for - Sent".
    Matt

  • How can I find the currently logined domain name on Windows??

    Dear,
    I've a program that query some user account information from A.D.
    But I don't want to hard code anything.
    I've read some previous post about using LDAP, and using DNS queries to found all LDAP server of A.D.
    But how can I get the A.D. domain name in Java?
    for example
    ldcp://_ldap._tcp.xxxx.yyyy
    I want to get "xxxx.yyyy" from the logined user account. It is possible in Java.

    You coud use the NTSystem class to derive the NetBIOS domain name, however without doing some gymnastics it isn't easy to derive the fully qualified domain name. import java.io.*;
    import com.sun.security.auth.module.NTSystem;
    class NTDomain {
         public static void main(String[] args) {
              NTSystem system = new NTSystem();
              String domain = system.getDomain();
              System.out.println("Domain: " + domain);
    }The only other alternatives could be to check the domain suffix of the user principal that was authenticated via Kerberos ....
    lc = new LoginContext(searchkrb5.class.getName(),new SampleCallbackHandler());
         lc.login();
         catch (LoginException le) {
              System.out.println("Logon failed: " + le);
              System.exit(-1);
         System.out.println("Authenticated via GSS-API");
            System.out.println("User: " + lc.getSubject().getPrincipals().toString); however I think that you still have to specifify the Kerberos realm in the apps configuration file.
    Another alternative could be to make assumptions about the machines hostname, however one day an assumption will always be proven wrong, (eg. The machine's DNS domain name does not need to match the Active Directory domain).
    Unless there is a Java API to read the Windows registry or extract Kerberos ticket information from the WIndows Kerberos ticket cache, you may be kind of stuck.

  • How can i get the path to config folder placed inside the jar file?

    Hi i have developed an RCP application using eclipse.
    In my application config directory is there.
    When i export my RCP application as JNLP Project the jar file is created which contains config folder inside it.
    When i download the application using java web start , how can i get the path to config folder placed inside the jar file?
    Will the config folder exists in local cache in my system?
    Help needed.
    -Deepak

    -- This works in CS6:
    tell application "Adobe InDesign CS6"
      set myDocument to active document
      set selectedRectangles to selection of myDocument
      set theGraphicsLink to file path of item link of (graphic 1 of (item 1 of selectedRectangles))
    --> "Macintosh HD:folder/folder/filename.tif"
    end tell

  • How can i open the directory/​folder and read all the files inside it in order and then close it?

    How can i open the directory/folder and read all the files inside it in order and then close it? any example would be nice.
    thanks

    In the File I/O>>Advanced File Functions Palette is a function named "List directory". This function will give you two arrays. One contains the names of all subdirectories the other the names of all files. If you want to sort them by name use the array sort function. If you want to sort them by another attribute use the File/Directory Info function to get more data. Use a cluster which contains the attribut to sort and the original index of the name. Then sort this array.
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • I have made a burn folder with photos exported from I-photo.  It now shows in information, that the date is created and modified is different from the original digitized date.  How can I get the original date to show in the info from Finder?

    I have made a burn folder with photos exported from I-photo.  It now shows in information, that the date  created and modified is different from the original digitized date.  How can I get the original date to show in the info from Finder?

    The Finder reports File information. The date and time of the photo are in the Photo's Exif metadata. The Finder has no awareness of this. All photos apps on any system do.
    Regards
    TD

  • How can I get the chapter numbering in automatic directory

    How can I get the new pages to take over the chapter numbering in automatic directory.

    Hi Peter,
    thank you for the quick answer.
    I'm new in the community therefor I have a additional question is there somebody reading who will take this as an feature for further updates of pages?
    I think this is a"must" for professionell work.
    Marcus

  • I accidentally erased a music album that I purchased on iTunes. How can I get the iTunes store to recognize that it is no longer in my iTunes library and download it again?

    I accidentally erased a music album that I purchased on iTunes. How can I get the iTunes store to recognize that it is no longer in my iTunes library and download it again?

    Delete the broken links in iTunes then look at your purchased list to redownload.
    If this happened because you were deleting files from the iTunes folder in Finder, don't.  You have to let iTunes do all the deleting and moving or you will end up with broken links.

  • How can I get the edited pictures from the thumbnails to full size?

    I upgraded to iPhoto 11, the thumbnail photos show my previous edits, but when I click on the photo to make it bigger, it reverts back to the unedited, original picture.  How can I get the edited pictures from the thumbnails to full size?

    Verify you are using iPhoto11 ver 9.5
    if not run the >Software update or check your apps folder and make sure the correct iPhoto is launched,  not an older ver.

  • HT1364 I have moved my library to an external hard drive and changed the location of the iTunes media folder in Preferences, but every time I close and re-open iTunes, I have to do it all over again.  How can I make the iTunes media folder change permanen

    I have moved my library to an external hard drive and changed the location of the iTunes media folder in Preferences, but every time I close and re-open iTunes, I have to do it all over again.  How can I make the iTunes media folder change permanent?  I have an older machine with Windows XP.

    I don't believe mounting the hard drive should be necessary, unless you have several external drives and want your computer to recognise them as folders, rather than drives. I've never had to mount a hard drive, ever. If you don't know how to do it, then it shouldn't be necessary now.
    Try this:
    Prepare iTunes so that it can see the external drive.
    Make a note of which drive-letter the external drive has been allocated. (Look in Windows Exploer)
    Look at the file location for a song. Make sure it plays (and therefore that iTunes has found it). Highlight it and select File/Get Info/Summary>Where: and make a note of the drive letter for that song.
    Close and shut down the computer.
    The next time you turn the computer on again, connect the external drive
    Before you start iTunes - check the external drive in Windows Explorer. Is it ready, does it have the same drive-letter that it had last time? Can you go into the drive and see the files on it?
    Once you can, start iTunes. (If the drive lettter has changed, you need to work out why before going any further.)
    If iTunes fails to find your external drive, you need to check where iTunes is looking for your Library.
    Select the same song you checked before (presumably iTunes can no longer find it). Follow the procedure for locating it. You should be able to see where iTunes thinks the file is. It's the drive that counts. Which drive letter is iTunes looking at? Is it the same one that it was previously (which should also be the same one that the drive has now).
    What happens, which step do you have problems with?
    Message was edited by: the fiend

Maybe you are looking for

  • DW CS3 Mac: paste fail

    Just to get this off my chest. I've been using DW from CS3 'Web Premium' (cough!) on a Mac running Tiger, then Snow Leopard, for a couple of years. In all that time, DW will only paste in 'text only' mode in design view regardless of what application

  • Planning application to production application

    Hi, can we copy the development planning application to production application.(i want to copy the outline),because we made changes in dev outline after migrating to production. please guide me how to do it. Bunny

  • How do I create to do in mail.app in Lion OS X

    I am new to Mac itself and bought Lion OS X. How do you create a "to do" in mail.app. when I read some user posts, I got to understand that right click on the message gives you a "to do" option. however I do not see it.

  • Clamshell - battery meter problem?

    Somebody has to be able to explain this one to me... I bought a used graphite 466 to hold me over until I can save up for a brand new laptop. It was running like a dream, at least until... I turned it on one morning, as I usually do... and the batter

  • How to get the SearchBar to work correctly inside a NavBar in iOS7

    have a tableview containing all the countries and their flags. I've been working to add a search bar and had it all working until I decided to move the search bar into the navigation bar allowed in iOS7 (for my purposes, that layout works very well).