Saving a file to a specified directory

Hello, how would i go about saving a file like from a JTextPane to anywhere the user selected from the JFileChooser menu. When I use the code below, it only gets stored in the directory where I run my program in.
import javax.swing.*;
import java.io.*;
import java.awt.*;
import package1.*;
import java.awt.event.*;
public class Test extends JApplet {
JTextPane tp = new JTextPane();
JButton b1 = new JButton("Save");
ActionListener al = new ActionListener() {
public void actionPerformed(ActionEvent e) {
JFileChooser fc = new JFileChooser();
int rVal = fc.showSaveDialog(Test.this);
ObjectOutputStream oos = null;
String fname = null;
if(rVal == JFileChooser.APPROVE_OPTION) {
fname = fc.getSelectedFile().getName();
try {
oos = new ObjectOutputStream(new FileOutputStream(fname));
oos.writeObject(tp.getText());
oos.close();
} catch(Exception ex) {}
public void init() {
b1.addActionListener(al);
Container cp = getContentPane();
cp.setLayout(null);
tp.setBounds(80,80,420,420);
cp.add(tp);
b1.setBounds(10,10,80,40);
cp.add(b1);
public static void main(String[] args) {
Console.run(new Test(), 500,500);
I know I could of used a better way of saving the text but I just slapped that part together, I just really wanted to see where the file would end up. I know if I add, for expample, c:\\java\\ to the string in FileOutputStream it would store the file in the java directory. But I can't figure how to get a list a accessed directories. All I can get is the current one with the getCurrentDirectory() method.
Thanks for any help.

Instead of:
fname = fc.getSelectedFile().getName();
use:
File file = fc.getSelectedFile();
FileOutputStream fos = new FileOutputStream( file );

Similar Messages

  • Saving a file in a specified directory

    I have this network-application where I ask new users to enter their information. I want to be able to store this information in a file under that user's username. I want to make the directory for the user at my server and save the file inside that directory. I have tried several things but nothing have worked so far... Any ideas as to how I can create a directory from within a java program and save a file in that directory?
    Thanks,
    tiwari

    1. Create a File object for the directory
    2. Create the directory on the filesystem with File.mkdir()
    3. Write to a file in the directory.

  • How to print out all files in a specified directory

    Now, I have some problem which prints out the entire content of all of the .txt files in a specified directory.
    what method i can use?
    Can anyone give me some examples?
    Many Thanks

    Read the API for java.io.File, in particular the list and listFiles methods, and java.io.FilenameFilter.

  • [SOLVED] C : How to block opening files "above" a specified directory?

    SOLVED: Used
    man 3 realpath
    Hello Archers,
    I have this one problem I've been struggling with. I kind of solved it but the solution's hackish.
    My question is how do you prevent the opening of files "above" a specified directory? The reason behind this is that I'm writing a simple sharing server, something like Xyne's quickserve, but in C and with a GTK GUI. I'm using the libmicrohttpd library.
    The program works this way: the user selects a port and a directory to be "served", and then he can access the files under the directory he chose. However, there obviously needs to be a way to prevent the user from opening files above the directory by using ".."'s for example.
    For now, I simply plan on rejecting all queries containing ".." (http://github.com/houbysoft/quickshare/ … hare.c#L59), but that's obviously very imperfect -- and you could get around it if there is a symlink in the directory for example.
    Any pointers will be very appreciated, thanks.
    Last edited by y27 (2010-03-17 02:59:14)

    tavianator wrote:
    man realpath wrote:BUGS
           The  POSIX.1-2001  standard  version of this function is broken by design, since it is impossible to
           determine a suitable size for the output buffer, resolved_path.  According to POSIX.1-2001 a  buffer
           of  size PATH_MAX suffices, but PATH_MAX need not be a defined constant, and may have to be obtained
           using pathconf(3).  And asking pathconf(3) does not really help, since, on the one hand POSIX  warns
           that  the  result  of  pathconf(3) may be huge and unsuitable for mallocing memory, and on the other
           hand pathconf(3) may return -1 to signify that PATH_MAX is not bounded.   The  resolved_path == NULL
           feature,  not  standardized  in  POSIX.1-2001,  but standardized in POSIX.1-2008, allows this design
           problem to be avoided.
    So be careful to either pass resolved_path as NULL and bite the potential unportablilty bullet, or copy canonicalize_file_name or canonicalize_filename_mode from gnulib.
    Yeah, I am passing NULL.

  • Writing an file to a specified directory

    I have an application in Tomcat. In this application i write data into an xml-file. When i check this, i see that the file is written in the bin directory of tomcat. Now I want to write this file into another directory, for example: /tomcat/webbaps/catalog/orders/order.xml
    Can someone tell me how my code to place it in this specified directory looks like?
    Thx !

    When you specify the file name, prefix it by the directory you want it stored in. You didn't show any code that explains how you are doing it now, so I'm not showing you any code that might be irrelevant. There are many ways to write an XML file to disk.

  • Error 7: File not found occurs in 8.2 from transition of 4.1. Specifying the file in file dialog returns error although file is in the directory.

    Copied a program from 4.1 to 8.2 recently and receive an error 7: File not found at open file+.vi.  The program is built so a file dialog will pop up and ask for the destination of the file.  Eventhough there is a file in the specified directory, an error is returned.  Running open file+.vi by itself returns no error with the same file designation.  Any clues?

    noviceak,
    Welcome to the NI Discussion Forums.
    I created a quick VI in LabVIEW 4.1 that displays a file dialog and then passes that file path to "Read Characters from File.vi" (which in turn calls Open File+.vi).  I then opened this file in LabVIEW 8.2 and ran it successfully (see code screenshot below).
    When you say there is a file in the specified directory are you using the file dialog to browse to the directory or to select the specific file?  Open File+.vi expects the path to a file rather than a directory - that is C:\folder\file.txt rather than C:\folder.  You might also want to create an indicator or probe to see what path is being passed to Open File+ to ensure it is what you expect.
    I feel like I should also say that in the days (years) inbetween LabVIEW 4.1 and 8.2 the file operation VIs have changed significantly.  While the old Open File+.vi still lives in vi.lib for compatibility purposes we no longer recommend using it for new applications.
    I hope this helps and again, welcome to the community.
    Regards,
    Simon H
    Applications Engineer
    National Instruments
    http://www.ni.com/support/
    Message Edited by Simon H on 01-18-2007 08:01 PM
    Message Edited by Simon H on 01-18-2007 08:03 PM
    Attachments:
    LV4 File Dialog.png ‏3 KB

  • How to view the file content from the directory? getting Error:ORA-21560

    SQL> create directory READ_LOB_DIR as 'D:\Prj\Comm\Data';
    CREATE OR REPLACE Procedure READ_FILE_LOB IS
    -- Input Directory as specified in create directory
    l_dir CONSTANT VARCHAR2(30) := 'READ_LOB_DIR';
    -- Input File which is read word by word
    l_fil CONSTANT VARCHAR2(30) := 'testfile.txt';
    -- Separator Character between words is a BLANK (ascii = 32)
    l_seb CONSTANT RAW(100) := UTL_RAW.CAST_TO_RAW(CHR(32));
    -- Character at the end of the file is NEWLINE (ascii = 10)
    l_sen CONSTANT RAW(100) := UTL_RAW.CAST_TO_RAW(CHR(10));
    -- Pointer to the BFILE
    l_loc BFILE;
    -- Current position in the file (file begins at position 1)
    l_pos NUMBER := 1;
    -- Amount of characters have been read
    l_sum BINARY_INTEGER := 0;
    -- Read Buffer
    l_buf VARCHAR2(500);
    -- End of the current word which will be read
    l_end NUMBER;
    -- Return value
    l_ret BOOLEAN := FALSE;
    BEGIN
    -- Mapping the physical file with the pointer to the BFILE
    l_loc := BFILENAME(l_dir, l_fil);
    -- Check if the file exists
    l_ret := DBMS_LOB.FILEEXISTS(l_loc) = 1;
    IF (l_ret) THEN
    dbms_output.put_line('File ' || l_fil || ' in Directory ' || l_dir ||
    ' exists');
    -- Open the file in READ_ONLY mode
    DBMS_LOB.OPEN(l_loc, DBMS_LOB.LOB_READONLY);
    LOOP
    -- Calculate the end of the current word
    l_end := DBMS_LOB.INSTR(l_loc, l_seb, l_pos, 1);
    -- Process end-of-file
    IF (l_end = 0) THEN
    l_end := DBMS_LOB.INSTR(l_loc, l_sen, l_pos, 1);
    l_sum := l_end - l_pos - 1;
    DBMS_LOB.READ(l_loc, l_sum, l_pos, l_buf);
    dbms_output.put_line(UTL_RAW.CAST_TO_VARCHAR2(l_buf));
    EXIT;
    END IF;
    -- Read until end-of-file
    l_sum := l_end - l_pos;
    DBMS_LOB.READ(l_loc, l_sum, l_pos, l_buf);
    dbms_output.put_line(UTL_RAW.CAST_TO_VARCHAR2(l_buf));
    l_pos := l_pos + l_sum + 1;
    END LOOP;
    DBMS_LOB.CLOSE(l_loc);
    ELSE
    dbms_output.put_line('File ' || l_fil || ' in Directory ' || l_dir ||
    ' does not exist');
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('Error:' || SQLERRM);
    DBMS_LOB.CLOSE(l_loc);
    END;
    The Text file content is...
    Copyright 1996,2001 Oracle Corporation.     All Rights Reserved
    This file contains installation instructions for installing the
    Oracle8 ODBC Driver software.
    It is divided into four parts:
    o Part I: Summary of systems supported by Oracle8 ODBC client
    software
    Lists the platforms on which the Oracle8 ODBC Client software can
    be installed.
    o Part II: Oracle8 ODBC Driver software.
    Describes the files, and installation prerequisites for the Oracle8
    ODBC driver software.
    o Part III: Exploding the kit onto your system
    Describes how to explode the kit onto your system hard drive.
    o Part IV: Installation Instructions
    Describes how to install the Oracle8 ODBC driver.
    Part I: Systems supported by the Oracle8 client software
    You can install the ODBC client software on any of the following systems:
    o Windows 2000
    o Windows NT X86
    o Windows 95
    o Windows 98
    The Oracle8 ODBC Driver provides support for ODBC connections
    from Windows 2000, Windows NT, Windows 95, and Windows 98 systems
    to Oracle databases.
    o Part II: Oracle8 ODBC Driver software.
    Refer to the following files for information about the Oracle8 ODBC Driver:
    LICENSE.TXT - Oracle8 ODBC Driver License Agreement. Read carefully
    before installing and/or using this product. Enclosed in
    your software distribution kit.
    SQORA.HLP - A Window's Help file which is the primary reference
              manual for the Oracle8 ODBC Driver.
    ODBCRelnotes.WRI - The release notes for the Oracle8 ODBC Driver
    which contains information which may have not been
    included in the Help file.
    Installation Prerequisites
    See the Oracle8 ODBC Driver release notes (ODBCRelnotes.WRI),
    for a complete list of software products required and their versions.
    Time Required
    The installation of the Oracle8 ODBC Driver takes approximately 5
    minutes. The actual time may be shorter or longer, depending upon
    your hardware configuration.
    Disk Space Required
    The Oracle8 ODBC driver installation requires approximately 2
    megabytes of available storage space. The space required depends upon
    what files you already have installed. The installation procedure
    checks to see if you have enough available disk space. If you do not,
    the installation fails.
    Part III: Exploding the Kit onto your system
    Expand the self-extracting archive file onto your hard drive.
    C:\> ORA8174.EXE
    Part IV: Installation Instructions
    Oracle8 ODBC Driver 8.1.7.4.0
    This section assumes the following:
    1. MS Windows 2000, Windows NT, Windows 95 or Windows 98 is running.
    2. Oracle Universal Installer shipping with 8.1.7 has already been
    installed on your system.
    3. Part III has been completed.
    Software fixes:
    Refer to release notes (ODBCRelnotes.wri) for a complete list of
    Software fixes.
    Installation Instructions
    Once the self-extracting archive file ORA8174.EXE has been
    exploded it will create an installable directory structure
    onto your hard drive. Run the Oracle Universal Installer from
    your local drive.
    1. On the screen "File Locations" use the "Browse" button of
    the source path to choose the file 'products.jar' from the
    folder that ORA8174.EXE was extracted to. Choose 'Next'.
    2. You will receive a warning that some of the dependencies of
    this product are not found in the staging area. This warning
    is OK. The ODBC driver depends on the Net8 Client being already
    installed on the system. Answer 'Yes' to continue.
    Oracle is a registered trademark of Oracle Corporation.
    Microsoft, MS are registered trademarks of Microsoft Corporation.
    Microsoft Windows, Windows NT, Windows 95, Windows 98 and Open Database
    Connectivity are trademarks of Microsoft Corporation.
    All other trademarks and registered trademarks are the property
    of their respective owners.
    The output was...
    File testfile.txt in Directory READ_LOB_DIR exists
    Copyright
    1996,2001
    Oracle
    Corporation.     
    All
    Rights
    Reserved
    This
    file
    contains
    installation
    instructions
    for
    installing
    the
    Oracle8
    ODBC
    Driver
    software.
    It
    is
    divided
    into
    four
    parts:
    o
    Part
    I:
    Summary
    of
    systems
    supported
    by
    Oracle8
    ODBC
    client
    Error:ORA-21560: argument 2 is null, invalid, or out of range
    I want to diplay/view as per file content format from the file under that specified directory.
    Have any other method / any help or suggestions would be really appreciated.

    I changed the code like...
    CREATE OR REPLACE Procedure READ_FILE_LOB_tmp IS
    -- Input Directory as specified in create directory
    l_dir CONSTANT VARCHAR2(30) := 'READ_LOB_DIR';
    -- Input File which is read word by word
    l_fil CONSTANT VARCHAR2(30) := 'testfile.txt';
    -- Separator Character between words is a BLANK (ascii = 32)
    l_seb CONSTANT RAW(100) := UTL_RAW.CAST_TO_RAW(CHR(32));
    -- Character at the end of the file is NEWLINE (ascii = 10)
    l_sen CONSTANT RAW(100) := UTL_RAW.CAST_TO_RAW(CHR(10));
    -- Pointer to the BFILE
    l_loc BFILE;
    -- Current position in the file (file begins at position 1)
    l_pos NUMBER := 1;
    -- Amount of characters have been read
    l_sum BINARY_INTEGER := 0;
    -- Read Buffer
    l_buf VARCHAR2(4000);
    -- End of the current word which will be read
    l_end NUMBER;
    -- Return value
    l_ret BOOLEAN := FALSE;
    BEGIN
    -- Mapping the physical file with the pointer to the BFILE
    l_loc := BFILENAME(l_dir, l_fil);
    -- Check if the file exists
    l_ret := DBMS_LOB.FILEEXISTS(l_loc) = 1;
    IF (l_ret) THEN
    dbms_output.put_line('File ' || l_fil || ' in Directory ' || l_dir ||
    ' exists');
    -- Open the file in READ_ONLY mode
    DBMS_LOB.OPEN(l_loc, DBMS_LOB.LOB_READONLY);
    LOOP
    -- Calculate the end of the current word
    l_end := DBMS_LOB.INSTR(l_loc, l_sen, l_pos, 1);
    -- Process end-of-file
    IF (l_end = 0) THEN
    EXIT;
    END IF;
    -- Read until end-of-file
    l_sum := l_end - l_pos;
    DBMS_LOB.READ(l_loc, l_sum, l_pos, l_buf);
    dbms_output.put_line(UTL_RAW.CAST_TO_VARCHAR2(l_buf));
    l_pos := l_pos + l_sum + 1;
    END LOOP;
    DBMS_LOB.CLOSE(l_loc);
    ELSE
    dbms_output.put_line('File ' || l_fil || ' in Directory ' || l_dir ||
    ' does not exist');
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('Error:' || SQLERRM);
    DBMS_LOB.CLOSE(l_loc);
    END;
    Now its working fine with one addtional line...
    The file content is...
    This is My Content
    This is My Content
    This is My Content
    This is My Content
    This is My Content
    But The output was...
    File testfile.txt in Directory READ_LOB_DIR exists
    This is My Content
    This is My Content
    This is My Content
    This is My Content
    This is My Content
    here, i want to delete that additonal line...?

  • Hello, when i open itunes i get the message: The iTunes Library file cannot be saved. A folder was specified instead of a file.  It seems I can't update my itunes library. how do i fix this? thanks in advance

    hello,
    when i open itunes i get the message: The iTunes Library file cannot be saved. A folder was specified instead of a file. 
    It seems I can't update my itunes library. how do i fix this? thanks in advance

    Hi there Br0x,
    You may want to try rebuilding the iTunes library as an initial troubleshooting step. Take a look at the article below for more information.
    iTunes: How to re-create your iTunes library and playlists
    http://support.apple.com/kb/ht1451
    -Griff W.

  • Weird CS4 error when saving eps files on a Mac: "...specified files already exist in the target location"

    Hi There,
    All 3 workstations in our studio are experiencing weird file behavior when re-saving eps files from Illustrator.
    Basically Illustrator creates a new file in addition to the original and adds a "-01.eps" onto the file name. If you re-save your original, Illustrator brings up a dialogue box that states:
    Some of the specified files already exist in the target location. The files marked below will be replaced:
    filename.eps
    filename-01.eps
    We've been deleting the "-01.eps" files each time but it's becoming tedious. The behaviour occurs when re-saving an eps file to a server or the desktop.
    All machines are new Quad-core MacPros running:
    - Leopard 10.5.8
    - Illustrator CS4 14.0.0
    We've checked for Illustrator updates from within Illustrator but we seem to be running the latest version.
    Is anyone else experiencing this behavior?
    Any help or pointers in the right direction would be much appreciated.
    Cheers
    Ben

    Thanks for the reply.
    The error occurs when we save the document but if we choose save as, "Use Artboards" seems to be unchecked so not sure if this issue is related or not. Will re-save the document using save as then see if the issue persists.
    Why do we still use eps?
    Basically because we've found it to be much more compatible. Our entire logo library is in eps format (18 years worth) partly because it was previously the only format to use and partly because it allows account managers to send logos to clients, printers, TV stations etc and not involve the studio (saving out an eps version).
    Although "Create PDF compatible file" is a good idea, we've encountered costly issues with colours and images - especially if the recipient is using old CS software, non-Adobe software or is using some kind of hardware RIP. We now just go with what we know works.
    But I do find saving eps versions of everything to be a bit painful. In fact, I've always found Illustrator in general to be a bit painful when compared with Photoshop or AfterEffects. Illustrator seems like it's been developed by a different company some times!
    Cheers, and thanks for the help.

  • I just installed ITunes 11.0.4. I get the error message: "The Itunes Library cannot be saved. A folder was specified instead of a file." When I sign on next, it says the library can't be found. Running Windows Vista with Mcafe protection

    I just installed ITunes 11.0.4. I get the error message: "The Itunes Library cannot be saved. A folder was specified instead of a file." When I sign on next, it says the library can't be found, and Itunes wont open. I'm running Windows Vista with Mcafe protection

    Hi there Br0x,
    You may want to try rebuilding the iTunes library as an initial troubleshooting step. Take a look at the article below for more information.
    iTunes: How to re-create your iTunes library and playlists
    http://support.apple.com/kb/ht1451
    -Griff W.

  • How to generate output file of a certain report in a specified directory

    Hello everyone,
    I wanna know how to generate the output file of a certain report in a specified directory.
    Now, the output file directory = /produits/OA/OAS/production/prodcomn/admin/out/PROD_us15k1bp/
    I wanna to generate the output file of a report in this directory
    /produits/OA/OAS/production/prodcomn/admin/out/PROD_us15k1bp/FACTCLIENT
    Cause the output of this report is very large, so I don't wanna to put it in the output drectory standard which reduce the performance.
    Could you help me?
    Thanks a lot,
    Kinkichin

    Hi,
    I wanna know how to generate the output file of a certain report in a specified directory.See (Note: 158088.1 - Is Possible to Redirect the Concurrent Processes Output to a Specific Directory for a Specific Responsibility?).
    Cause the output of this report is very large, so I don't wanna to put it in the output drectory standard which reduce the performance.There should be no performance issues you place the output file in the same directory where other concurrent request output files are located.
    Regards,
    Hussein

  • ITunes Library file cannot be saved. A duplicate file name was specified.

    Every time I open up iTunes I get the error 'The iTunes Library file cannot be saved. A duplicate file name was specified.'
    I've had this problem for a couple of months, tried out every solution I can find, changed the library names, recreated the library etc. Recreating the library seemed to work for a few days, but now the problem has returned. Because of this problem I can't add any new songs to my iTunes, and I cannot update any of my apps.
    Any help would be appreciated!

    I also have the same problem as in the duplicate file was specified thing after opening up itunes.
    But for me is the apps. I can't download or update my apps from my comp but i can do that on my iphone. I did tried to transfer purchases but it popped up about something that if i dont authorize this comp my apps will be removed. When i clicked dont authorize, it removed almost all my apps so i stopped in the middle of syncing. I click authorize and after entering my apple ID, another pop up saying that there is an error in transfering the purchases and told me to repair my itunes. I tried that too but it didnt work. I already did authorize my comp long ago. When i clicked cancel, it doesnt sync all my stuff and remains the same cause it always stuck at the apps. I tried to uninstall itunes but it says there's an error in the package thing, error code 2330. Any idea on what should i do? >_<

  • Receiving "The Itunes Library file cannot be saved. A duplicate file name was specified".

    Itunes Version 10.5.3.3
    Using Iphone 4 on Windows 7 Proffesional PC.
    Keep getting "The Itunes Library file cannot be saved. A duplicate file name was specified" when trying to sync Itunes with Iphone.
    Have tried the following steps;
    first you have to locate your last library file, you can do this by clicking Edit-preferences-advanced. it will show you the itunes media folder location. then close Itunes
    open your folder and locate the last library (libraries are saved with date names, find the most recent one or the one that was last modified).
    change the name of the library to today´s date following the format it already has. you will have to change the name for libraries: .itl, .xml, genius and extras.
    once you have changed the name to today´s date on the 4 libraries you will have to delete all other libraries existing on the same folder or on a folder named "previous itunes libraries". it is also recommended to delete the itunes "preferences file" .dat (usually 1kb) and the "sentinel" file.
    so, you will have on your itunes media folder only 4 libraries: .itl .xml genius and extras.
    the next step is to click the itunes icon holding the "shift" key . itunes will ask you to either "quit, choose library or create library" click on choose library. then locate the library you just renamed with today´s date and extension .itl
    done, itunes will open with the last saved version of your library. keep in mind that some changes or songs will not be present if you added any while getting the error "itunes cannot save the library file. a duplicate name has been specified" just locate the songs and add them again, if you have the option "copy files to itunes media folder when adding to library" checked. then go to file-add folder or file-and locate the songs missing on the itunes media folder.itunes saves the files on the hard drive but does not save the changes on the library.
    No luck.
    Any help would be greatly appriciated.

    I found the solution:
    first you have to locate your last library file, you can do this by clicking Edit-preferences-advanced. it will show you the itunes media folder location. then close Itunes
    open your folder and locate the last library (libraries are saved with date names, find the most recent one or the one that was last modified).
    change the name of the library to today´s date following the format it already has. you will have to change the name for libraries: .itl, .xml, genius and extras.
    once you have changed the name to today´s date on the 4 libraries you will have to delete all other libraries existing on the same folder or on a folder named "previous itunes libraries". it is also recommended to delete the itunes "preferences file" .dat (usually 1kb) and the "sentinel" file.
    so, you will have on your itunes media folder only 4 libraries: .itl .xml genius and extras.
    the next step is to click the itunes icon holding the "shift" key . itunes will ask you to either "quit, choose library or create library" click on choose library. then locate the library you just renamed with today´s date and extension .itl
    done, itunes will open with the last saved version of your library. keep in mind that some changes or songs will not be present if you added any while getting the error "itunes cannot save the library file. a duplicate name has been specified" just locate the songs and add them again, if you have the option "copy files to itunes media folder when adding to library" checked. then go to file-add folder or file-and locate the songs missing on the itunes media folder.itunes saves the files on the hard drive but does not save the changes on the library.
    hope this is clear enough.

  • "The iTunes Library file cannot be saved.  A folder was specified instead of a file."  How do I fix?

    My buddy set me up with the Aiport Timecapsule with 500G of music.  I linked iTunes to my MacPro (took a looong time) now I keep getting "The iTunes Library file cannot be saved.  A folder was specified instead of a file."  I have the most up to date iTunes.  I'm not sure that I set up the library the "proper way" but don't want to spend another day or 2 to reload.  How do I fix what ever I did wrong, or get rid of the message?
    Thanx

    Hi there Br0x,
    You may want to try rebuilding the iTunes library as an initial troubleshooting step. Take a look at the article below for more information.
    iTunes: How to re-create your iTunes library and playlists
    http://support.apple.com/kb/ht1451
    -Griff W.

  • When I update itunes it deletes the library file, and when I restore that file from the previous libraries or my backup, itunes will run but tell me "the iTunes library file cannot be saved. A folder was specified instead of a file" How do I fix this?

    When I update itunes it deletes the library file, and when I restore that file from the previous libraries or my backup, itunes will run but tell me "the iTunes library file cannot be saved. A folder was specified instead of a file" How do I fix this?

    Hi there Br0x,
    You may want to try rebuilding the iTunes library as an initial troubleshooting step. Take a look at the article below for more information.
    iTunes: How to re-create your iTunes library and playlists
    http://support.apple.com/kb/ht1451
    -Griff W.

Maybe you are looking for