Opening ini files

Hi everyone,
I need to access files (preferably ini or .txt) from CVI. I have searched this site but could only find read/write to excell files. Is there anyone who could either point me in the right direction or provide some samples. Thanks!
Kat

What I do in TestStand is to call kernel32.dll and GetPrivateProfileStringA. Here's a simple example.
Attachments:
ReadINIFile.seq ‏27 KB

Similar Messages

  • Memory leakage when using Ini-file VIs

    I'm using the Configuration File Vis to read and write data to different .ini files. The files contain both standard keys and clusters written as a segment using the Open G toolkit. Instead of opening the files and keeping them in the memory of the Config VIs I'm just using them to read and write, decode and encode...the references are all closed using the Close Config Data.vi. The problem is that even though immediately close the config data the application keeps grabbing more and more data...every time a configuration file is open, read or written to and the closed everything from 4K to 50K of additional memory has been allocated by the application (this is a stripped down application that only deals with the config files, so
    there are no other sources for the memory leak).
    Has anyone else experienced this? How can you repeatedly open and close config file slike this without it continoulsy allocating more memory?
    Attached is a copy of the VIs, the directory structure must be kept intact if the ini file is to be read correctly.
    I've been stearing so hard on this the whole day that I might just be overlooking something obvious...
    In the full application the VI init and write operations are only done when the user reconfigures the system, which may be a couple of times per month...so the memory leak would not cause a problem right away, but it would not be healthy to leave it there...
    MTO
    Attachments:
    Memory_Leak_Demo.zip ‏1391 KB

    Could you post a 6.1 version?
    LV7 is still about two weeks away for me.
    Does the problem show up in 6.1?
    I ran across an error while writting to a FP output that was not configured that would cause a "drop of memory" to leak every time the VI performed the write. The leak did not show up in the profiler but windows would show te memory foot print growing continually as long as the writes continued. The work around was "don't do that!".
    I bring this up because I found and reported this just prior to LV7 release and the featur may still be present in LV7. I also believe that Jean-Pierre used a "write and check" metod to detail with the unknown data types of of complex data structures.
    If you just read does it leak?
    If you just use simple data types do
    es it leak?
    Is the ini file growing?
    I really appreciate the effort you have been putting into the Dev-Exchange Mads! I wish i could do to more to help.
    Keep us posted.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Lion server file sharing issue with windows API read/write ini file (GetPrivateProfileString)

    Hello,
    I try to config lion server as file server for a windows application we use at work. All other computers are windows 7 or XP, lion server is the only mac. I choose lion server because it's size, quality and personal love of apple products.
    10.7.2 lion server's samba file sharing works almost perfectly with all my windows machines, I can copy, delete, modify any text files or office files without any issue, but the most important windows application for my business doesn't work with samba file sharing. After some digging, I found it is because windows program can't read or write INI file stored on lion share. Windows API GetPrivateProfileString always returns empty if the INI file is store on lion share.
    You can download a small application for read/write windows INI file from codeproject.com to test this problem:
    http://www.codeproject.com/KB/files/ini.aspx
    I can open/edit the in file using any text editor without any problem. The only problem is with those windows APIs. ACL is turned on for my lion share and assigned "delete" rights to samba users.
    I install samba3 on the same server; it works perfectly with windows API. My windows program also works. Looks like there is something wrong with lion server's sambax.
    I'd prefer to use built-in samba even I have samba3 working. Built-in samba is very immature right now, but considered how young it is, I will give apple some time to make it mature.
    Does anyone have same issue or knows how to fix it?
    Thanks,
    Michael.

    All the memory is fine. The server rarely if ever goes down when there are only around 10-12 users connected. When there are 20+ users connected and working heavily it goes down often. When I say working heavily, I mean they are transferring huge files to the SAN (100GB+), sometimes 5 at a time per user, and there are a bunch of others who are reading large video files at a minimum of 220MB/sec from the SAN.
    Though this worked on Snow Leopard without any issues, Lion just doesn't seem to be able to handle it. The odd thing is, on Snow Leopard there was only a single 1GB ethernet connection to a NAS system, whereas with Lion we have a much more powerful machine with a 6-port 10GB ethernet card and a 4 lane 8GB fiber card to a true SAN. You would think that the newer scenario with Lion would handle far more users with ease.
    So far, very disappointing with regards to Lion's file serving performance.

  • .INI files vs .TXT files for changing default values in a .EXE?

    Hi,
    I have a two-part question related to updating the default values of controls in an executable:
    I am creating a LabVIEW executable for installation on two different production-floor computers.   I need to be able to change the default values of the front panel controls (as I would do with the “make this value default” command during development). From reading prior posts, I understand that I could use the “Write Configuration Settings File.vi” and “Read Configuration Settings File.vi” to generate a .INI file that would be read by the .EXE and would establish the desired values of the controls. However when I took a look at the block diagrams for those configuration .VIs, they don’t appear (to me) to be any easier to use than just reading values from a spreadsheet file. IE: Instead of using these configuration files and a .INI file, could I not instead just read values from a .TXT file that contains the desired values?   I’ve never used a .INI file before, or had to worry about “keys” and “sections,” so from my (perhaps naïve) perspective, the .INI method seems less easy to use. Is there any advantage to the .INI format?
    Regardless of whether I use the .INI file or a .TXT file, I have this additional problem: One of the things that changes when I install my .EXE file on a new computer is the COM port numbers used by two serial devices.   (On my development computer, the two serial devices use COM5 and COM6, whereas on the two production-flood computers, the COM ports will almost certainly be different).   I suppose I could use the Device Manager on the production-floor computers to change the COM ports to be the same as those on my development computer, but I’d prefer to be able to (again) change the default value of the COM ports in my .EXE.   However, I’m not sure how to do that.   The configuration VIs, have options for reading / writing Booleans, strings, paths, and numeric, but not, (so far as I can tell) for a VISA class.
    Any thoughts / suggestions are welcome. Thanks.
    Solved!
    Go to Solution.

    Dan_the_Clam wrote:
    Thanks for your reply, Yamaeda,
    Great that I can use a string to open a VISA session - I had no idea.  I'll try that.  
    And - ah - you are right about the .INI files.  I just did an experiment in which I re-ordered the sections and randomly changed which letters were capitalized in the key values, and the "read configuration settings.VI" still read the file correctly.  Thanks for that.
    Unfortunately, in my existing code, the controls on the block-diagram aren't all co-located together; they are scattered throughout the block diagram - some of them in case structures and loops.   I suppose that means I'll have to move them all to the left side of the block diagram, route them to these "Write Key.VIs" and then wire them up into the cases and loops with fairly long wires.   It's just a hassle, and is going to make my block diagram more complicated.  Well, I suppose that's how one learns...
    Thanks again.
    dan
    Assuming you have a state machine and an Init state it's a fair use of Local Variables to update controls from the ini-file. The same goes for saving the values.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Firefox profile cannot be loaded. It may be missing or inaccessible - yet no profile.ini file is missing (folder empty), clean reinstall has not not worked

    I'm running windows 8 and had recently handed my computer back to be repaired. When I got my computer back I started getting the error that states that "Your Firefox profile cannot be loaded. It may be missing or inaccessible." upon opening.
    I've had this before and just renamed the profile.ini file as something different forcing Firefox to create a new profile. However the profile.ini file is not there, at all.
    Everything that I've searched for shows profile management through firefox, but I can't open firefox to create any profiles so they don't help at all.
    Does anyone know

    This is usually caused by a problem with the profiles.ini file and the profile marked as Default=1 is no longer present on the hard drive.
    *Windows: "%AppData%\Mozilla\Firefox\"
    *Linux: ~/.mozilla/firefox/
    *Mac: ~/Library/Application Support/Firefox/
    *Delete the profiles.ini file to force Firefox to create a new default profile
    *Use the Profile Manager to create a new profile
    *Use "Choose Folder" to recover an existing profile if there is still one present
    *http://kb.mozillazine.org/Profile_Manager
    *https://support.mozilla.org/kb/Managing+profiles
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    The "AppData" folder in Windows Vista and later Window 7+ versions and the "Application Data" folder in XP/Win2K are hidden folders.
    *http://kb.mozillazine.org/Show_hidden_files_and_folders
    Create a new profile as a test to check if your current profile is causing the problems.
    See "Creating a profile":
    *https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox-profiles
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
    If the new profile works then you can transfer some files from an existing profile to the new profile, but be cautious not to copy corrupted files to avoid carrying over the problem.
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • How to access/open rpd files in offline mode from client desktop

    Hi All,
    Please tell me what configuration settings I need to have on my desktop to access RPD files stored on BI server?
    In our OBIEE environment, we have BI server installed on linux server, and I have installed BI admin tool on my desktop (Windows OS).
    I need to know what settings I should configure in my NQSConfig.ini file on my desktop so that I can access rpd files stored on BI server...
    I can access online RPD using BI server ODBC connectibity, but want to access other offline RPD files stored in repository directory on linux server where OBIEE 11g server installation is done.
    Thanks and Regards
    Santosh
    Edited by: 910192 on 22-Feb-2012 08:09

    Saichand,
    Highly appreciate your response.
    But wht I am looking for is how to access other RPD files stored in repository folder on server machine where BI server is running, from BI administration tool which is installed on my desktop
    I am able to access default online repository on BI server using ODBC configuration from BI admin tool on my desktop, but want to access other rpd files (lets say sample rpd files which are installed on BI server machine) using (file->open-offline) option.
    As per Jay, it seems it is not possible to access repositories other than online repository on BI server, and I will have to copy those rpd files on my desktop and then access using file->open->offline option in BI admin tool.
    If you have any other way of doing this or have done this somehow , please let me know.
    Thanks and Regards
    Santosh

  • How to configure the .ini file with applet

    hai
    i am using native methods in that methods they use some ip addresses. when i am using that native methods in applet run the applet using appletviewer tool it works fine but when i am open that applet using html page browser not configure that .ini file data .how to configure that .ini file with browser

    Hi Jay SenSharma,
    Thanks for your immediate response.
    I saw your URL links, But in your link give the recursive deployment using wlst. But my question is how to configure the oracle weblogic library files into Admin server & Managed Servers by using the wls.jar file through wlst script to create the new domain.
    But if create the new domain by using GUI mode then we manually give the admin server port number & managed servers port number and name.
    By default the library files are configured with the Admin server in GUI mode. But the Managed server the Library files are not configured with the Managed servers. Then we manually select all the library files to the corresponding managed servers. Then only the applications are deployed into the corresponding managed server.
    Regards,
    S.vinoth Babu

  • Why will Firefox 3.6.3 not open Quicktime files from the Apple Website on a Mac OS X 10.6.3?

    While trying to view the Iphone 4 page on Apple, firefax will not open the quicktime video. But Safari will open this file. Why?
    == URL of affected sites ==
    http://www.apple.com/uk/iphone/features.html#design-video

    Hello superdavis78, try in [http://kb.mozillazine.org/Profile_folder_-_Firefox#Mac profile folder] to delete the [http://kb.mozillazine.org/Profiles.ini_file profiles.ini] file to force Firefox to create a new default profile.
    see also: [https://support.mozilla.org/en-US/kb/Recovering%20important%20data%20from%20an%20old%20profile#os=mac&browser=fx19 Recovering important data from an old profile]
    [http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox Transferring data to a new profile - Firefox]
    thank you

  • "Search in Files" inside .ini files

    I use the site search and search in file features in Dreamweaver quite often but I just discovered that if I have a folder full of .ini files and I need to search globally inside those files Dreamweaver returns no results.
    Apparently, DW is unable to search inside files other than HTML, PHP, CSS, JS, etc. But it won't search in .ini files or any weird (for DW) file extensions.
    I once was able to set up my DW to look inside PHTML files (Used by Magento) as well as applying code coloring to them as it would on PHP files.
    I suspect this is a similar process but I wanted to make sure I was not seeing things. Is DW really that dense that will not search inside a file with an extension it doesn't know?
    By the way, I did add .ini to the recognizable files in preferences, but obviously that's not enough to have DW search inside them.
    OFF TOPIC COMMENT
    Another weird thing I just noticed is that the "asset" and other modules will only work in WYSIWYG view. Meaning that if I save a color in my assets I cannot use it to insert it in a CSS file. Not even in code view. I have to be in the visual editor for it to work, but then it's useless to me.
    Incidentally, some time ago I found that the visual editor in DW is actually very useful when working with dynamic websites like Drupal or wordpress. Especially when dealing with very large pages with lots of CSS files.
    However, no one IO know would or should build their sites in the visual editor. It's simly a bad way to work. Why would adobe limit the use of the "assets" pane (and the "History pane too now that I remember)  to the visual editor is beyond me in this day and age.
    I do a lot of tasks where it would be greast to copy a procedure like a substiotution and have DW repeat the same procedure on other pages or similar code snippets. Yet, it won't alow me.
    I love Dreamweaver and I am actually writing a book on how to use it with the likes of wordpress, drupal, etc. It cuts dowen development and design time by less than a third. If those things worked everywhere instead of just in the visual editor it would cut down even more on the time it ntakes to design dynamic website templates.
    Sorry about the rant.
    Thank you for any help.

    Hi David, I too have worked closely on a lot of software projects and I am well aware of the limitations. In fact, that's one of the reasons I lioke to work on open source projects because of the vast talent pool they can utilize. Private companies, no matter how big, neet to triage new development according to their resources.
    By the way, adding the .ini files to the extension.txt files in Dreamweaver is pretty easy. Since code coloring is not an issue that's really the only change I need to make. When I integrated the PHTML file extension for Magento I had to make a lot more changes (still manageable though).
    One of your comments, about DW keeping its legacy features in a changing web development world, made me think that it may be time for Adobe to spawn a different IDE or start thinking about a more modular approach to the application.
    I am writing a book on Dreamweaver integration for Open Source web scripts and when talking to other open source developers, one thing that comes up often is that Dreamweaver is a "bloated" program  (this is not my complaint, by the way).
    Part of the issue is that it needs to keep a lot of quasi-obsolete features so that long time users won't abandon the platform. Which featrures are obsolete is really up to each user. For me the WYSIWYG view is certainly not something I would use to design web sites, but should Adobe get rid of it,  it would absolutely destroy my workflow since I use it to rapidly target HTML, CSS and even Core PHP code in the template and the file system of the scripts I work with.
    The new "Live view" in CS4 was a welcome addition, especially since the basic page rendering in DW leaves a lot to be desired (Incidentally Microsnot "Expression" page rendering is a lot better, making the live view feature less exceptional except when troubleshooting JS based effects).
    Anyway, that said, DW is an extensible program and there are a lot of thrid party utilities written for Dreamweaver. Couldn't the Adobe team use this extensibility to make improvements to the interface and even use it to add or subctract features from the main application?
    I think they are mising an opportunity here to capture a wider audience. DW could ship with a minimal set of features and the team could choose to release their own add-ons so that users could build their own application.
    I think that approach would silence a lot of critics, since the basic app would now be a lot slimmer, while still giving power and legacy users the features they need a-la-carte.
    I am actually hioping that once my book comes out (if it ever does: the publishing world moves at a snail's pace) it may give the DW team a new perspective on how to use Dreamweaver in a modern web development enviroment, but honestly my biggest hope is for one of the current open source projects like Eclipse to look at my development system and maybe add some Dreamweaver-like features so that finally there would be a real open source alternative to Dreamweaver. In turn, I believe that will make DW move a bit more quickly in adding new features and shedding the obsolete ones.
    Anyway, thank you again for the links, I did submit my suggestions. I am not holding my breath but we'll see.
    Take care

  • LV RTE cannot open project files that have .lvlib references in Dependencies

    I'm writing a LabVIEW DLL to inspect LabVIEW project files, and I've noticed that if a project has a .lvlib reference in its Dependencies, then the Run-Time Engine contradicts itself about whether or not it can find the project file:
    Project.Open returns error 7 (file not found)
    Project.GetFileLVVersion is successful
    Here are snippets from my G and C code that exercise this behavior:
    int openStatus = StatusSuccess;
    char* projectVersion = createStringWithLength(VersionStringLength);
    printf("Analyzing %s\n", pathString);
    OpenProject(pathString, &openStatus, projectVersion, VersionStringLength);
    printf(" Project written in LabVIEW %s\n", projectVersion);
    if (openStatus == StatusSuccess)
    printf(" Opened project file.\n");
    else
    printf("Error: Could not find project file, or file was not a project file (error code %i).\n", openStatus);
    However, when running in the development environment, both methods succeed.
    Is this a bug, and if so, is it fixed in LabVIEW 2014?
    Here is how you can reproduce it:
    Prerequisites:
    LabVIEW 2013 SP1 32-bit
    ConEmu for a good console -- https://code.google.com/p/conemu-maximus5/wiki/Downloads
    minGW for compiling a program to use the LabVIEW DLL -- http://sourceforge.net/projects/mingw/files
    .lvlib reference in Dependencies breaks Project.Open in LV RTE
    Unzip the attachment into a temporary directory (eg c:\xtra\temp)
    Open "OpenProject.lvproj" in LabVIEW.
    Build "Open Project Library".
    Using ConEmu with a bash prompt, navigate to the temporary directory.
    Type make
    $ make
    patching file `builds/platdefines.h'
    gcc -std=c99 -g OpenProject.c -o OpenProject.exe -lOpenProject -Lbuilds
    6. Type OpenProject 'c:\xtra\temp\OpenProject.lvproj'
    $ OpenProject 'c:\xtra\temp\OpenProject.lvproj'
    Analyzing c:\xtra\temp\OpenProject.lvproj
    Project written in LabVIEW 13.0
    Opened project file.
     7.  Notice that both invoke nodes execute correctly.
     8.  Type OpenProject 'c:\xtra\temp\OpenProjectWithLvlibDep.lvproj'
    $ OpenProject 'c:\xtra\temp\OpenProjectWithLvlibDep.lvproj'
    Analyzing c:\xtra\temp\OpenProjectWithLvlibDep.lvproj
    Project written in LabVIEW 13.0
    Error: Could not find project file, or file was not a project file (error code 7).
     9.   Notice that the version node succeeded while the open one failed.
     10. Type diff OpenProject.lvproj OpenProjectWithLvlibDep.lvproj
    $ diff -u OpenProject.lvproj OpenProjectWithLvlibDep.lvproj
    --- OpenProject.lvproj Tue Nov 4 11:28:28 2014
    +++ OpenProjectWithLvlibDep.lvproj Tue Nov 4 11:32:37 2014
    @@ -13,7 +13,11 @@
    <Property Name="server.vi.propertiesEnabled" Type="Bool">true</Property>
    <Property Name="specify.custom.address" Type="Bool">false</Property>
    <Item Name="OpenProject.vi" Type="VI" URL="../OpenProject.vi"/>
    - <Item Name="Dependencies" Type="Dependencies"/>
    + <Item Name="Dependencies" Type="Dependencies">
    + <Item Name="vi.lib" Type="Folder">
    + <Item Name="NI_MABase.lvlib" Type="Library" URL="/&lt;vilib&gt;/measure/NI_MABase.lvlib"/>
    + </Item>
    + </Item>
    <Item Name="Build Specifications" Type="Build">
    <Item Name="Open Project Library" Type="DLL">
    <Property Name="App_copyErrors" Type="Bool">true</Property>
    Here is another way to trigger this behavior, which also shows that LabVIEW only sometimes tidies the Dependencies item:
    Open "OpenProject.lvproj" in LabVIEW.
    Add a new VI to the project and place the "Application Directory" file path constant its block diagram.
    Select "File » Save All (this Project)" and use the default name for the new VI.
    Type OpenProject 'c:\xtra\temp\OpenProject.lvproj'
    Notice there is an error again, as is expected.
    Remove the "Application Directory" file path constant.
    Select "File » Save All (this Project)"
    Type OpenProject 'c:\xtra\temp\OpenProject.lvproj'
    Notice the problem is gone, as is expected.
    Re-add the "Application Directory" file path constant to the block diagram.
    Select "File » Save All (this Project)"
    Type OpenProject 'c:\xtra\temp\OpenProject.lvproj'
    Notice there is no problem, which is surprising as there should be an error since the Dependencies item hasn't been tidied.
    Close the new VI and remove it from the project.
    Select "File » Save All (this Project)"
    Open "OpenProject.lvproj" in a text editor.
    Notice the Dependencies item has been tidied.
    Re-add the VI back to the project.
    Select "File » Save All (this Project)"
    Type OpenProject 'c:\xtra\temp\OpenProject.lvproj'
    Notice there is an error again, as is expected.
    Solved!
    Go to Solution.
    Attachments:
    LVRTE_OpenProject.zip ‏10 KB

    NInjaneer_wow wrote:
    The same behavior occurs in LabVIEW RTE: a new project with an Application Directory constant in a blank vi will return error 7 - file not found, but still return the correct version of LabVIEW in which the project was created. 
    I've been experimenting with workarounds for this behavior, and I found one.
    When I provide the LabVIEW path for libdir in my executable's ini file, the run-time is able to load and inspect the project file.
    libdir="C:\Program Files\National Instruments\LabVIEW 2013"
    While it's expected that a stand-alone executable may be placed on a system that doesn't have the LabVIEW IDE, it's still surprising to me that the Run-Time Engine cannot find LabVIEW's standard library without some explicit guidance. What other considerations contribute to that behavior?
    References:
    LabVIEW configuration file/Paths -- http://labviewwiki.org/LabVIEW_configuration_file/Paths

  • Saplogon.ini file location question

    Hi, any advice would be appreciated thanks
    we have rolled the sap gui 6.40 to all our clients - all using a local copy of the saplogon.ini file in the local windows directory. however we wish to change this approach and have a central saplogon.ini file on a file server and point all the clients to this file.. any changes only then have to be made in one place.
    can anyone help me with this, firstly is it possible, and if so how to change the client setting to adjust the location.
    many thanks.

    Hi thanks for your link.
    The document you pointed me towards led me to SAP note number 756686
    which explains that you can edit the SAP icon on your desktop (by right-clicking and opening with notepad) and then adding a line cmd="/ini_file='path to ini file'\saplogon.ini'
    Thanks for your assistance.
    Edited by: Mike Ellis on Mar 4, 2008 1:05 PM

  • How to open a file through OpenOffice

    hi,
    My program is currently able to open files(resumes) that are saved under MS-Word ,the problem is at our client's place there is only openoffice installed, can anyone suggest me what alterations in the program are to be made to get the above task done.
    here is the code for your better understanding.:
    private void showCandidateResume() {
            String fileName = null;
            if (candidate != null) {
                try {
                    fileName = candidate.getResumePath();
                    ERPClient.readRemoteFile(fileName,"work"); // read the file from the
                                                        // remote server.
                    String ext = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length());
                    fileName = System.getProperty("user.dir") + "/work/temp." + ext;
                    fileName = "\"" + fileName + "\"";
                    // opens candidate resume
                    // XXX bad code. works only in windows clients...
                    String OS = System.getProperty("os.name").trim();
                    if (OS.equals("Windows 95") || OS.equals("Windows 98") || OS.equalsIgnoreCase("Windows ME")
                            || OS.equals("Linux")) {
                        Log.write("\r\nOpening " + fileName);
                        Runtime.getRuntime().exec(editor + " " + fileName);
                    } else {
                        Log.write("\r\nOpening " + fileName);
                        String[] cmd = { "cmd.exe", "/C", fileName };
                        Runtime.getRuntime().exec(cmd);
                } catch (UnknownHostException ex) {
                    Console.printException(ex);
                    JOptionPane.showMessageDialog(MainFrame.window, "Server not found. Unable to show resume.");
                } catch (IOException ex) {// if unable to open the file get
                                            // another external application to open
                                            // it.
                    if (ex.getMessage().indexOf("CreateProcess") != -1) {
                        if (JOptionPane
                                .showConfirmDialog(
                                        null,
                                        "The application could not find a default editor to open this file. \nPlease choose an application to open the file.",
                                        "Open With", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
                            JFileChooser fc = new JFileChooser(new File("c:\\Program Files"));
                            fc.showDialog(MainFrame.window, "Open With");
                            editor = fc.getSelectedFile().toString(); // get the
                                                                        // user
                                                                        // defined
                                                                        // editor.
                            if (editor != null) {
                                try {
                                    ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("editor.ini"));
                                    out.writeObject(editor); // write the
                                                                // selected editor
                                                                // to file.
                                    out.close();
                                    Log.write("Setting Default Editor : " + editor);
                                    String[] cmd = { editor, fileName };
                                    Runtime.getRuntime().exec(cmd);
                                    Log.write("Opening " + fileName + " in " + editor);
                                } catch (Exception e) {
                                    e.printStackTrace();
                } catch (Exception ex) {
                    Console.printException(ex);
                    JOptionPane.showMessageDialog(MainFrame.window, "Error..!!. Unable to show resume.");
        }

    when i select openoffice it opens the file that is all junk Confirm that the file is able to be viewed by OpenOffice. Ie, open the file
    from within OpenOffice and verify that it is compatible.
    Also it would be a good idea to find out exactly what the IOException
    is as this covers a lot of territory - os path, file permissions etc. You can
    do this by adding the lineConsole.printException(ex);to the top of the second catch block. Then get the exception from
    whatever Console is.
    Unless I'm mistaken, the fileName variable is being used to refer to a
    directory not a file. You can figure out what "editor" and "fileName"
    really are - and whether they are sensible in your context - by looking at
    the log. There will be two lines likeSetting Default Editor : editor executable name
    Opening fileName in editor executable name

  • Write ini file not readable

    Hi all,
    I store configuration data in an ini file and give this file a custom extension.
    If users open this file in a text editor I don't want it to be readable.  Without encrypting the text how can I do this?
    I cant seem to get the binary VIs to work.  Maybe somebody could show me?
    Cheers,
    Battler.

    You haven't really defined how secure you want your data, but if you just want a simple way to hide the information from a casual user, this may work.
    Obviously, if someone really wanted to, they could figure this out.
    steve 
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.
    Attachments:
    write scrambled file.vi ‏14 KB
    read scrambled file.vi ‏13 KB

  • Error with ini files & Memory Error

    Hi All,
    I am attaching my VI which is used to save the control values, I am doing it with configuration file, but sometimes what happens my configuration file got erased completely,and my data got lost otherwise saving control values works perfectly fine,  how can I stop this so my configuration data is safe. or is there any other method to save the control values.
    2ndly, I have another error in a different vi which keeps coming (image is attached as "Memory Error"), I tried installing LV and XP again, changed the PC but problem persists.
    Could someone please try to throw some light on these issues.
    Thanks & Regards
    James
    Attachments:
    ini error.PNG ‏24 KB
    Save control values.vi ‏50 KB
    Error2.JPG ‏1 KB

    Your Error2 image is not viewable. Looks like a corrupt upload.
    Your fundamental problem lies in the first part of your code. If the INI file doesn't exist, then when you open it, a new one gets created. There is no SVALUE key, so you are trying to loop 0 times. Since the first for-loop does not execute, the INI file refnum does not get transferred through the tunnel, and subsequent INI file functions receive a null refnum. You need to either wire the refnum outside the loops or use shift registers for the refnum.
    As to your code: OK...
    You must really like whitespace, because that's the only reason I can see for having such a huge while loop that just sits there.
    You really need to learn to draw straight wires.
    You are jumping through unnecessary hoops. You are taking the control values, bundling them into a cluster, converting the cluster into an array, and then autoindexing the array while at the same time setting the "N" terminal of the for-loop. Whew!
    Skip the bundling. Just make an array directly!
    Do not wire both the "N" terminal of a for-loop and autoindex. Do one or the other. Since you have the array, just auto-index.
    The Index Array function is resizable. You do not need to place 2 of them to get the 2 values.
    Your string constants are in 2 places. You should have them in one place only. If you decide to change the names then you need to remember to change them in 2 places.

  • Where Can the Preference Settings to place in the .INI File Found

    I can not find a lot of the settings that are found on the drop down list under the Menu item Edit - Preferences. Specifically I am looking for the setting to stop Acrobat asking clients to update. I know it can be done manually. I deliver Acrobat over the company network to thousands of clients of which my helpdesk cannot go to everyone of them. Where is the setting found. In the .ini file or in the registry and what is the actual code to be placed in the .ini file or the HKey in the registry?

    Here's how to find various registry keys:
    1. Open RegEdit. Navigate to HKCU and Export The Adobe Acrobat hive under the Software/Adobe key. Close regedit
    2. Launch Acrobat and make your preference change.
    3. Open Regedit again and export the Adobe Acrobat hive again. Us a program that can compare text and find the change thats was made.

Maybe you are looking for