Error in renaming file

This is the code to create a file and rename it..
import java.io.*;
class renamefile2
public static void main(String[] args) throws IOException
File file = new File("saranya");
boolean success = file.createNewFile();
if (success)
{System.out.println("file created");}
else
{System.out.println("file exists");}
boolean done = file.renameTo("naanee") ;
if (done)
{System.out.println("renamed successfully") ; }
else
{System.out.println("not renamed successfully") ; }
Im getting the error:::
C:\mywork>javac renamefile2.java
renamefile2.java:12: renameTo(java.io.File) in java.io.File cannot be applied to
(java.lang.String)
boolean done = file.renameTo("naanee") ;
^
Please help me solve !!

You can get the API documentation at :
http://www.google.com/search?l=en&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=Calendar+API+in+java&spell=1
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html
You have to do something like :
Calendar c = Calendar.getInstance();
int day = c.get(Calendar.DAY);
int month = c.get(Calendar.MONTH);
int year = c.get(Calendar.YEAR);
String date = day+" / "month" / "+year;

Similar Messages

  • Prelude Renaming Files Error

    I get this error when trying to ingest and rename files to my hard drive... I only get file to transcode and make alias name w/ the ext. _1. What in the process am i missing or what is it about the possible file that I am not seeing that is not allowing me to specify and ingest with a chosen file name?

    Hi Johnny,
    Could also check the AME version you are using? The latest version of Prelude is 2.2.0 and the AME is 7.2.0. Please ensure you have upgraded them to the latest version.
    If your platform is Win and you want to transcode a clip to 'QuickTime', please install QuickTime software on your machine.
    Hopfully this will resolve your issue, if not, just let me know.
    Thanks,
    Jenny

  • FTP send to VAN process generates error after rename attempt on file already moved to an archive.

    I am sending an EDI file to a server managed by a VAN (This same process handles multiple other FTP locations, first VAN), what is happening is that after the file is dropped the FTP adapter does a rename and tries to add the file extension .edi to the file.
    The problem is that the VAN moves the file as soon as it is received to an archive and by the time the adapter tries to rename the file is gone and an error is sent back to BizTalk.
    The file is in the VAN fine and according to them they don't care about missing a file type.
    The problem is that I start getting the suspended messages in BizTalk and I have a manual process that tries to resend suspended messages causing duplicate files to be sent.
    I tried to issue a "QUIT" on the "AFTERPUT" property but this did not work, how do I stop BizTalk from trying to rename the file or tell BizTalk not to send a "fail" message back.
    Thanks   
    Bico Bielich

    Duplicate thread, see here:
    https://social.msdn.microsoft.com/Forums/en-US/e7130b69-22c9-45b3-b369-9a207cbc16b5/error-renaming-file-being-dropped-in-ftp-server-of-a-van-?forum=biztalkgeneral

  • ORA-01511:error in renaming data file & ORA-01516: nonexistent data file

    Hi all,
    DB version is 10.2.0.2 and Applications 12.0.6 on RHEL 4
    While creating data file mistakenly we created with '?' as follows:
    "/d01/CRP/db/apps_st/data/tx_?data53.dbf"
    After that we tried to rename those data file using below steps but we are geting error message as follows:
    1.SQL>ALTER TABLESPACE APPS_TS_TX_DATA OFFLINE NORMAL; at DB in OPEN stage
    2.$mv /d01/CRP/db/apps_st/data/tx_?data53.dbf /d01/CRP/db/apps_st/data/tx_data53.dbf
    3.ALTER TABLESPACE APPS_TS_TX_DATA RENAME DATAFILE '/d01/CRP/db/apps_st/data/tx_?data53.dbf' TO '/d01/CRP/db/apps_st/data/tx_data53.dbf';
    ERROR at line 1:
    ORA-01511: error in renaming log/data files
    ORA-01516: nonexistent log file, datafile, or tempfile
    "/d01/CRP/db/apps_st/data/tx_?data53.dbf"
    After that we tried to revert back by moving to original name usinf os commnds i.e tx_?data53.dbf and tried to open the database as follows but getting error message as follows:
    SQL> startup mount
    ORACLE instance started.
    Total System Global Area 1073741824 bytes
    Fixed Size 1264892 bytes
    Variable Size 440402692 bytes
    Database Buffers 620756992 bytes
    Redo Buffers 11317248 bytes
    Database mounted.
    SQL> recover database;
    Media recovery complete.
    SQL> alter database open ;
    alter database open
    ERROR at line 1:
    ORA-01092: ORACLE instance terminated. Disconnection forced
    Please help us t oresolve the Issue
    Edited by: 912734 on Feb 15, 2012 2:43 AM

    Errors in alert log file:
    ALTER TABLESPACE APPS_TS_TX_DATA RENAME DATAFILE '/d01/CRP/db/apps_st/data/tx_?data53.dbf' TO '/d01/CRP/db/apps_st/data/tx_data53.dbf'
    Wed Feb 15 15:38:58 2012
    ORA-1525 signalled during: ALTER TABLESPACE APPS_TS_TX_DATA RENAME DATAFILE '/d01/CRP/db/apps_st/data/tx_?data53.dbf' TO '/d01/CRP/db/apps_st/data/tx_data53.dbf'...
    Wed Feb 15 15:40:10 2012
    ALTER TABLESPACE APPS_TS_TX_DATA RENAME DATAFILE '/d01/CRP/db/apps_st/data/tx_ data53.dbf' TO '/d01/CRP/db/apps_st/data/tx_data53.dbf'
    Wed Feb 15 15:40:10 2012
    ORA-1525 signalled during: ALTER TABLESPACE APPS_TS_TX_DATA RENAME DATAFILE '/d01/CRP/db/apps_st/data/tx_ data53.dbf' TO '/d01/CRP/db/apps_st/data/tx_data53.dbf'...
    ALTER TABLESPACE APPS_TS_TX_DATA ONLINE
    Wed Feb 15 15:41:09 2012
    Errors in file /d01/CRP/db/tech_st/10.2.0/admin/CRP2_oraapps/bdump/crp2_dbw0_1605.trc:
    ORA-01157: cannot identify/lock data file 11 - see DBWR trace file
    ORA-01110: data file 11: '/d01/CRP/db/apps_st/data/tx_
    data53.dbf'
    ORA-27037: unable to obtain file status

  • RH 10 - SVN - PushOk plugin: Error occurs by renaming files

    I'm testing the integration of RoboHelp Projects with SVN (with PushOk plugin).
    Everything has worked well until now apart from renaming files. The following error occurs:
    COM.SvnClient.Error, HRESULT=0x80020009
    Path '...' is not a directory
    There is a similar discussion from 2010 in the forum:
    http://forums.adobe.com/message/3005946#3005946
    The suggestion is to duplicate the topic into a new name. But this is not a workaround for us. What about hyperlinks referencing the topic?
    I can't see this beeing the only way to rename files. Isn't there another solution?

    Did you check the solutions mentioned in this doc?
    http://helpx.adobe.com/creative-suite/kb/errors-exit-code-6-exit.html

  • LR 3.2 Renaming files on import error

    Hi all, an  error on importing and renaming files seems to have cropped up. In the last week or so I have imported some files from a cf card, only to have LR 3.2 "say" that "LR has imported certain files but the following images cannot be renamed" and the preview is greyed out. Double clicking on the "greyed out" image doesnt help either. The images are in the catalogue and first deleting them via LR and then reimporting them seems to work.
    Any thoughts?
    Kind regards

    Thanks for responding. They show in - C:\Users\Roy Shopland\Pictures\2010\2010-08-30.  They actually appear under 2010 in the left hand column (at the beginiging of 2010  rather than under the date in 2010. Can you explain why this is and how can I correct it? Many thanks

  • Sharepoint 2013 ItemAdded event receiver for renaming files is not working

    In SP 2013 I coded an event receiver that intercepts the ItemAdded event and it just renames the file.
    It is a synchronous event (I added <Synchronization>Synchronous</Synchronization> in the Elements.xml).
    This is the code:
            public override void ItemAdded(SPItemEventProperties properties)
                SPSecurity.RunWithElevatedPrivileges(delegate()
                    try
                        OutputDebugStringA("Inside ItemAdded");
                        string szHttpUrl = properties.WebUrl + "/" + properties.AfterUrl;
                        SPWeb openedWeb = properties.Web.Site.OpenWeb(properties.Web.ID);
                        SPFile spf = openedWeb.GetFile(szHttpUrl);
                        EventFiringEnabled = false;
                        string szUrl = properties.AfterUrl;
                        szUrl = szUrl + ".renamed";
                        string szNewFileName;
                        if (szUrl.LastIndexOf('\\') != -1) szNewFileName = szUrl.Substring(szUrl.LastIndexOf('\\') + 1);
                        else if (szUrl.LastIndexOf('/') != -1) szNewFileName = szUrl.Substring(szUrl.LastIndexOf('/') + 1);
                        else szNewFileName = szUrl;
                        if (properties.ListItem != null)
                            properties.ListItem["Title"] = szNewFileName;
                            properties.ListItem.Update();
                        spf.MoveTo(szUrl);
                        EventFiringEnabled = true;
                        base.ItemAdded(properties);
                        OutputDebugStringA("Renaming to " + szUrl);
                    catch (System.Exception exception)
                        OutputDebugStringA("ItemAdded ERROR: " + exception.ToString());
    The problem is that when I upload a .txt file using Internet Explorer, just after the renaming is done, IE says that something went wrong and when I inspect the log files I see:
    SPRequest.GetFileAndFolderProperties: UserPrincipalName=i:0).w|s-1-5-21-4050800873-4278272723-3073177257-500, AppPrincipalName= ,bstrUrl=http://sp2013/sites/demo/subsite1 ,bstrStartUrl=Shared Documents/test2.txt ,ListDocsFlags=16400 ,bThrowException=True 0fa7689c-674b-5045-c3a2-b214a5d4cbed
    01/09/2014 15:29:26.75  w3wp.exe (0x1544)                        0x16F4 SharePoint Foundation        
     General                        ai1wu Medium   System.IO.FileNotFoundException: <nativehr>0x80070002</nativehr><nativestack></nativestack>,
    StackTrace:    at Microsoft.SharePoint.SPWeb.GetFileOrFolderProperties(String strUrl, ListDocsFlags listDocsFlags, Boolean throwException, SPBasePermissions& permMask)     at Microsoft.SharePoint.SPFile.PropertiesCore(Boolean
    throwException)     at Microsoft.SharePoint.SPFile.get_Length()     at Microsoft.Office.RecordsManagement.PolicyFeatures.ApplicationPages.UploadPage.OnSubmit(Object o, EventArgs e)     at Microsoft.Office.RecordsManagement.PolicyFeatures.ApplicationPages.UploadExPage.OnSubmit(Object
    o, EventArgs e)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     at System.Web.UI.Page.ProcessRequest(Boolean includeSta... 0fa7689c-674b-5045-c3a2-b214a5d4cbed
    ...gesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     at System.Web.UI.Page.ProcessRequest()     at System.Web.UI.Page.ProcessRequest(HttpContext context)     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()    
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)     at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)     at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext
    context, AsyncCallback cb)     at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr
    rootedObjectsPointer, IntPtr nativeRequestContex... 0fa7689c-674b-5045-c3a2-b214a5d4cbed
    ...t, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr
    pHandler, RequestNotificationStatus& notificationStatus)     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr
    rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) 
     0fa7689c-674b-5045-c3a2-b214a5d4cbed
    So it is clear that the fact that I renamed the file is causing an issue in the SharePoint upload logic.
    As a solution what I did was to not declare it as Synchronous, but if I do it then there is another error when Sharepoint shows the Edit Properties dialog... in this case the upload is OK but when it is time to show that Edit Property dialog IE fails and
    says that the file has been already modified, or that "something went wrong".
    If I use a synchronous event I get one problem. If I use the asynchronous event I get another problem... It's very frustating and I am pretty sure that a so important API like Event Receivers should have support renaming files so I hope someone can tell
    me what I am doing wrong.
    Thanks in advance

    May be you want to consider using the following code and see if it works for you.
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/40c78e03-2dca-4083-89d2-a7430099da68/how-do-i-change-the-name-property-of-a-file-in-a-document-library?forum=sharepointdevelopment
    Amit

  • Error 1308.Source file not found with 9.4.2 Admin Install point

    I'm including as much information in this post as possible to help narrow down my problem, so if it's too wordy I appologize.
    I've created an Admin install point for Acrobat 9 patching it up to Acrobat 9.4.2 using the following commands in a batch file:
    D:
    cd \Adobe\Acrobat\AcrobatPro9
    md \Adobe\Acrobat\AcrobatPro9AIP
    start /wait msiexec /a AcroPro.msi TARGETDIR=D:\Adobe\Acrobat\AcrobatPro9AIP /Liv D:\Adobe\Acrobat\AcrobatPro9AIP\install900.log /qn
    cd \Adobe\Acrobat\AcrobatPro9AIP
    start /wait msiexec /p D:\Adobe\Acrobat\AcrobatPro9\AcroProStdUpd910_T1T2_incr.msp /a AcroPro.msi TARGETDIR=D:\Adobe\Acrobat\AcrobatPro9AIP PATCHAIP=1 /Liv install910.log /qn
    start /wait msiexec /p D:\Adobe\Acrobat\AcrobatPro9\AcrobatUpd912_all_incr.msp /a AcroPro.msi TARGETDIR=D:\Adobe\Acrobat\AcrobatPro9AIP PATCHAIP=1 /Liv install912.log /qn
    start /wait msiexec /p D:\Adobe\Acrobat\AcrobatPro9\AcrobatUpd920_all_incr.msp /a AcroPro.msi TARGETDIR=D:\Adobe\Acrobat\AcrobatPro9AIP PATCHAIP=1 /Liv install920.log /qn
    start /wait msiexec /p D:\Adobe\Acrobat\AcrobatPro9\AcrobatUpd930_all_incr.msp /a AcroPro.msi TARGETDIR=D:\Adobe\Acrobat\AcrobatPro9AIP PATCHAIP=1 /Liv install930.log /qn
    start /wait msiexec /p D:\Adobe\Acrobat\AcrobatPro9\AcrobatUpd932_all_incr.msp /a AcroPro.msi TARGETDIR=D:\Adobe\Acrobat\AcrobatPro9AIP PATCHAIP=1 /Liv install932.log /qn
    start /wait msiexec /p D:\Adobe\Acrobat\AcrobatPro9\AcrobatUpd933_all_incr.msp /a AcroPro.msi TARGETDIR=D:\Adobe\Acrobat\AcrobatPro9AIP PATCHAIP=1 /Liv install933.log /qn
    start /wait msiexec /p D:\Adobe\Acrobat\AcrobatPro9\AcrobatUpd940_all_incr.msp /a AcroPro.msi TARGETDIR=D:\Adobe\Acrobat\AcrobatPro9AIP PATCHAIP=1 /Liv install940.log /qn
    start /wait msiexec /p D:\Adobe\Acrobat\AcrobatPro9\AcrobatUpd941_all_incr.msp /a AcroPro.msi TARGETDIR=D:\Adobe\Acrobat\AcrobatPro9AIP PATCHAIP=1 /Liv install941.log /qn
    start /wait msiexec /p D:\Adobe\Acrobat\AcrobatPro9\AcrobatUpd942_all_incr.msp /a AcroPro.msi TARGETDIR=D:\Adobe\Acrobat\AcrobatPro9AIP PATCHAIP=1 /Liv install942.log /qn
    I rename the folder "AcrobatPro9AIP" to reflect the current version (e.g. "Acrobat9.4.2"), copy the folder to my DFS, create an MST with the Customization Wizard, and then deploy with Group Policy.
    Before I deploy I always run a few test installations on two Windows XP 32-bit machines, and two Windows 7 64-bit workstations. I've been using this method to build my install point for the last 5 Adobe patches without a problem, but suddenly with version 9.4.2 my test workstations pop up with the following error during the installation via the standard installation method "msiexec /i acropro.msi TRANSFORMS=acropro.mst":
    I built my installation package for acrobat9.4.1, 9.4.0 and 9.3.3 exactly the same way and the installations did not have this error. The file in question "Adobe.Acrobat.Dependencies.manifest" does not exist in my 9.4.1, or 9.4.0 package folders, nor does it exist in the 9.4.2 folder. Any suggestions?

    I am having the same problem, all the relevant info was already covered in the "thewaker" post above.   I too have made a script to make a Admin install with patches up to 9.4.2.  The script worked for 9.3.3 but when I remade the AdobeAIP for 9.4.2, I too got this error when installing it, even manually.  (Error 1308.Source file not found.  Adobe.Acrobat.Dependencies.manifest ) Running on Windows 7 32bit.
    Here is my Script.
    C:
    cd\AcroBatPro9
    md \AcrobatPro9AIP
    start /wait msiexec /a AcroPro.msi TARGETDIR=C:\AcrobatPro9AIP /Liv c:\AcrobatPro9AIP\install900.log /qn
    cd \AcrobatPro9AIP
    start /wait msiexec /p c:\AcrobatPro9\AcroProStdUpd910_T1T2_incr.msp /a AcroPro.msi TARGETDIR=C:\AcrobatPro9AIP PATCHAIP=1 /Liv install910.log /qn
    start /wait msiexec /p c:\AcrobatPro9\AcrobatUpd912_all_incr.msp /a AcroPro.msi TARGETDIR=C:\AcrobatPro9AIP PATCHAIP=1 /Liv install912.log /qn
    start /wait msiexec /p c:\AcrobatPro9\AcrobatUpd920_all_incr.msp /a AcroPro.msi TARGETDIR=C:\AcrobatPro9AIP PATCHAIP=1 /Liv install920.log /qn
    start /wait msiexec /p c:\AcrobatPro9\AcrobatUpd930_all_incr.msp /a AcroPro.msi TARGETDIR=C:\AcrobatPro9AIP PATCHAIP=1 /Liv install930.log /qn
    start /wait msiexec /p c:\AcrobatPro9\AcrobatUpd932_all_incr.msp /a AcroPro.msi TARGETDIR=C:\AcrobatPro9AIP PATCHAIP=1 /Liv install932.log /qn
    start /wait msiexec /p c:\AcrobatPro9\AcrobatUpd933_all_incr.msp /a AcroPro.msi TARGETDIR=C:\AcrobatPro9AIP PATCHAIP=1 /Liv install933.log /qn
    start /wait msiexec /p c:\AcrobatPro9\AcrobatUpd940_all_incr.msp /a AcroPro.msi TARGETDIR=C:\AcrobatPro9AIP PATCHAIP=1 /Liv install940.log /qn
    start /wait msiexec /p c:\AcrobatPro9\AcrobatUpd942_all_incr.msp /a AcroPro.msi TARGETDIR=C:\AcrobatPro9AIP PATCHAIP=1 /Liv install942.log /qn
    I did notice though that the "thewaker" has added AcrobatUpd941_all_incr.msp to his script, which is a security update. Which may be "a" problem, but I don’t think this is related to the problem we are having.
    Administrative deployment
    Administration Installation Point (AIP) deployments must not apply a quarterly update AIP in which a security update was the most recently applied update. Because a quarterly update includes the changes implemented in all recent security updates, the quarterly update forcibly bypasses those updates entirely. To deploy a quarterly update from an AIP, create a AIP which includes only quarterly updates as follows:
        Acceptable:      Acrobat 9.0.0 -> 9.1.0 (Quarterly) -> 9.1.2 (Quarterly) -> 9.2.0 (Quarterly) -> 9.3.0 (Quarterly) -> 9.3.2 (Quarterly) -> 9.3.3 (Quarterly) ->  9.4.0 (Quarterly) -> 9.4.1 (Security)
        Acceptable:      Acrobat 9.0.0 -> 9.1.0 (Quarterly) -> 9.1.2 (Quarterly) -> 9.2.0 (Quarterly) -> 9.3.0 (Quarterly) -> 9.3.2 (Quarterly) -> 9.3.3 (Quarterly) -> 9.4.0 (Quarterly) -> 9.4.2 (Quarterly)
        Unacceptable:  Acrobat 9.0.0 -> 9.1.0 (Quarterly) -> 9.1.2 (Quarterly) -> 9.2.0 (Quarterly) -> 9.3.0 (Quarterly) -> 9.3.2 (Quarterly) -> 9.3.3 (Quarterly) -> 9.4.0 (Quarterly) -> 9.4.1 (Security) -> 9.4.2 (Quarterly)
    Anyway.. Any help with this would be helpful as I would like to deploy it soon.
    Thanks.

  • Error on uncompressing file

    Hi !
    We have one user getting the following error message when trying to log on to SAP BPC for Excel:
    "Error on uncompressing file: ActiveX component can´s create object"
    "Cannot download templates from server"
    And after this error message BPC opens but there are no dimensions available in CV.
    Anyone who knows what can be wrong?
    /Fredrik

    It definitely looks like xceedzip is the culprit...there are several SAP Notes that deal with xceedzip and all pretty much have the following solution. 
    If there is an existing xceedzip.dll in the x:\programs files\bpc directory, unregister and rename the file first.                                                            
    Solution                                                                 
    This problem was resolved by:                                                                               
    1.  Obtaining the XceedZip.dll from the application server's             
    x:\bpc\websrvr\web\installation directory.                                                                               
    2.  Copying and pasting that file to the client's x:\programs files\bpc  
    directory.                                                                               
    3.  Registering the file on the client machine using regsvr32.

  • How to open renamed files?

    Hi
    I rename selected files and after that want to open them.
    For my purpose renaming works well like this:
    tell application "Finder"
    set FilesToRENAME to selection
    display dialog "Change what?" default answer ""
    set ChangeFROM to text returned of the result
    display dialog "Change to?" default answer ""
    set ChangeTO to text returned of the result
    set AppleScript's text item delimiters to {ChangeFROM}
    set theCount to count of FilesToRENAME
    repeat with x from 1 to theCount
    try
    set theName to name of item x of FilesToRENAME
    set FirstNamePart to first text item of theName
    set LastNamePart to second text item of theName
    set newName to FirstNamePart & ChangeTO & LastNamePart
    set name of item x of FilesToRENAME to newName
    on error errStr number theNumber
    activate
    display dialog "Error in changing the Name " & theNumber & return & errStr ¬
    & return & "Step " & x
    end try
    end repeat
    set AppleScript's text item delimiters to ""
    end tell
    Now newly renamed files don't belong anymore to FilesToRENAME. So how to point to those files now (how to make a new list from those renamed files)? I was thinking to get a path to each file inside the repeat loop and replace the name, but couldn't do it.
    Thank you for any help.
    Vera

    Pierre's method is pretty clever, but if you don't happen to be using a Finder selection (choose file for example), you can also use the interesting fact that an alias keeps track of an item even if it is moved or renamed.
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #DAFFB6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    -- tell application "Finder" to set filesToRename to selection as alias list
    set filesToRename to (choose file with multiple selections allowed)
    set changeFrom to text returned of (display dialog "Change what?" default answer "")
    set changeTo to text returned of (display dialog "Change to?" default answer "")
    set renamedFiles to {} -- this will be the renamed files
    repeat with aFile in filesToRename
    set aFile to the contents of aFile
    tell application "Finder" to set theName to name of aFile
    try
    set tempTID to AppleScript's text item delimiters
    set AppleScript's text item delimiters to {changeFrom}
    set firstNamePart to first text item of theName
    set lastNamePart to second text item of theName
    set AppleScript's text item delimiters to tempTID
    set newName to firstNamePart & changeTo & lastNamePart
    tell application "Finder"
    set name of aFile to newName -- aFile points to the original file
    update aFile -- give Finder a chance to catch up
    set the end of renamedFiles to aFile -- aFile now points to the renamed file
    end tell
    on error errStr number theNumber
    activate me
    display alert "Error " & theNumber & " in changing the Name" message errStr
    end try
    end repeat
    renamedFiles --> aliases to the renamed files
    </pre>

  • Adobe reader (11.3.2) PDF's on ipad and getting error that the file is corrupt!!

    i have the latest Adobe reader from the app store (11.3.2) however i am struggling to open PDF's on ipad and getting error that the file is corrupt!!
    any help or suggestions welcome

    Would you describe how you transferred the PDF file to your iPad and iPhone?  Did you send it as an email attachment and open it on your iPad and iPhone?
    The file may have been corrupted by Apple Mail, which is a known problem.  Please see Problem #1 in the FAQ document How to avoid known PDF email attachment problems.
    Would you try some experiments so that we can troubleshoot the problem?  During the experiments, please use cloud storage (e.g. Acrobat.com, Dropbox, Google Drive, etc.) and avoid sending the PDF file as an email attachment.
    Rename the corrupted/damaged PDF file on your iPad.  For example, add "_damaged.pdf" to the file name.
    Upload the corrupted/damaged PDF file to the cloud storage of your choice.
    Download the corrupted/damaged PDF file from the cloud storage to your Windows or Mac desktop computer.
    Open it in the desktop version of Adobe Reader XI for Windows or Mac.
    Does Adobe Reader XI on your desktop computer display an error message?
    Upload the (good) PDF file on your iPhone to the cloud storage.
    Download the (good) PDF file from the cloud storage to your iPad.
    Open it in Adobe Reader on your iPad.
    Does Adobe Reader on your iPad display an error message?
    We can investigate further based on what you will find.
    Thank you for your help.

  • Renaming files in OS X Snow Leopard with illegal chars..

    I'm still using Leopard but want to know if the behavior of renaming files is on par of that in, gasp, Windows Vista. I was jsut doing a lot of renaming and it reminded me of the days I used to use Vista when renaming a file and using an 'illegal' character it would pop-up a yellow dialog (not an error window) to remind me of the characters I can use only.
    In OS X Leopard 10.5x if I try to use e.g. ":" I get an error box and this then reverts the file back to its original name which erases all of what I had done, all for one char probably. On top of this the error box then gives me a cryptic message as to what the error was about:
    "The name "xxxxx" cannot be used.
    Try using another name, with fewer characters or no punctuation marks."
    I heard that the guys working on OS X 10.6 Snow Leopard tidied everything up, doing all those things they always wanted to do, I bet they didn't get many opportunities like that! And was hoping that they did something toward file rename?
    I'd expect that the erroneous char would be highlighted and some kind of error shown, but not to delete everything typed in. Can anybody tell me?
    Thanks.

    It's a unix thing, and not quite something I'd classify as needing to be cleaned up...
    • The only illegal character for file and folder names in Mac OS X is the colon “:”
    • File and folder names are not permitted to begin with a dot “.”
    • File and folder names may be up to 255 characters in length

  • Cannot upgrade itunes due to error " c:program files|quicktime h264"?????

    I just got myself a brand spanking new ipod, my husband has an older nano and uses itunes our computer. Itunes did not recognize my new ipod and said i had to upgrade to version 9. but when i try to download the upgrade i get an error message saying ERROR WRITING TO FILE: C:PROGRAM FILES\QUICKTIME\QTSYSTEM\QUICKTIMEH264.RESOURCES\NL.LPROJ\QUICKTIMEH264LOCALIZE DQTR.VERIFY THAT YOU HAVE ACCESS TO THAT DIRECTORY.
    what the **** does that mean??? ive been on the computer all day dying to use my new ipod, have uninstalled itunes and quicktime but still it gives me the same error message. can someone please help, im going crazy, im desperate!!!!!

    Yeah, there's anothe workaround we can try ... it doesn't fix the damaged files/folders, but it convinces the installer to ignore them and create new ones (instead of getting hung up trying to remove and replace the damaged ones).
    In My Computer, open your C drive.
    Open the "Program files" folder.
    Open the "QuickTime" folder.
    Open the "QTSystem" folder.
    Open the "QuickTimeH264.Resources" folder.
    Rename the "nl.lproj" folder nl.lprojOLD.
    Now try another install. Does it go through properly this time?

  • Automator: Impossible to rename file using automator under Mac OS X Lion

    Hi,
    Before upgrade my iMac to MAC OS X Lion 10.7.2, I had service created with automator under snow leopard in order to rename my pictures file names by blocks instead of one by one. Since I'm using Lion, this one doesn't work anymore. I have completely recreate the service under Lion and the results is the same.
    You can find below my workflow that is easy. The problem is the message error in the history of automator application. The message is "impossible to rename file "file name" because this one should create conflict with existing file". I already test a lot of times with different name where I'm sure that this one doesn't exist on my Mac but all the time without success (verify also with search function under mac)
    If somebody can help me, it would be very interesting because I already tried to find answer on internet without success too.
    Thanks in advance for your help.

    the whole automator and in particular the record action was substantially rewritten in snow leopard. and the record action is slow, unreliable and you can't trouble-shoot it. it's a wonder it works at all. the only advice i can give is to use it as little as possible. if at all possible avoid it altogether. if you do need to use it try using keyboard strokes instead of the mouse movement. for example. use command+c and command+v for copying and pasting and use tabbing to choose the correct box on the page.

  • Renaming files with invalid characters in their names on NTFS partitions, introduced by operating systems other than Windows

    Essentially, Linux created some files with colons (:) in the name on a NTFS partition where I have Windows installed. I have since uninstalled Linux, but now I can only view these files in Windows Explorer. I can't open them, I can't even rename them to
    correct the problem. It's as if they don't exist, because of the invalid search paths.
    If I try to rename them in Windows Explorer I get following message.
    The file name you specified is no valid or too long.
    Specify a different file name.
    Well isnt' that something?... isn't that nice? Windows is able to display these files, but it doesn't allow me to open them and it certainly doesn't like me to rename them. So why is it whining about it then, when I'm trying to help? It says "try a different
    file name". Yeah, right! Like I haven't tried that one already! It doesn't matter what file name I input it will never accept it.
    So what am I supposed to do now? Ditch Windows and go back to Linux? Surely, Microsoft doesn't like the sound of that. Sure, I could reinstall Linux or run a Linux live system to correct the problem. But what good is Windows then? I might as well switch to
    Linux altogether.
    After doing some research I now know by fact that it's (kind of) possible to rename files from UNIX and UNIX-like operating systems to those compliant with Windows by using something called file name character translation. To some level this is essential and
    necessary for Windows interoperability with other operating systems (Windows is not the only operating system in the world). But this seems to be very complicated and I can't get my head around it. My brain is in overload. I don't know where to start.
    Once there was a...
    There's the Windows Services for UNIX (SFU) 1.0, 2.0, 3.0, 3.5. The first two versions were based on MKS Toolkit, a package licensed by Microsoft from MKS Inc. The later versions were based on the similar Interix product, after Microsoft purchased the company
    that made it.
    Then there's the new Subsystem for UNIX-based Applications (SUA). These are services for UNIX components. They are supposed to have Client for NFS v3 included as well. But the server components from the SFU line is missing (e.g. Server for NFS). These are included
    in Server editions of Windows.
    Then there's the Microsoft Knowledge Base article
    289627: "How to Enable File Name Character Translation". This article seems to describe exactly my situation.
    Windows and UNIX operating systems have restrictions on valid characters that can be used in a file name. The list of illegal characters for each operating system, however, is different. For example, a UNIX file name can use a colon (:), but a Windows
    file name cannot use a colon (:). If a UNIX user attempts to create a file with a Windows illegal character on a Windows Services for UNIX network file system (NFS) share, the attempt is unsuccessful and the UNIX client computer receives an input or output
    error.
    It goes further than that. At first glance, this KB article also seems to offer a solution to this exact problem, with examples as shown below.
    For example, the following maps the UNIX colon (:) to a Windows dash (-):
    0x3a : 0x2d ; replace client : with - on server
    I checked these values in charmap.exe and they are correct. Except for 2D not being a "dash", it's rather a hyphen ("hyphen minus" to be exact), but these two have pretty much the same appearance and they get interchanged a lot, I'm sure
    they are used to it by now. (Yes, the characters! They don't mind.)
    Then there's this registry key.
    HKEY_LOCAL_MACHINE\Software\Microsoft\Server For NFS\CurrentVersion\Mapping
    Well, of course, I don't have Server for NFS. So this is a dead end. Well, actually, it was a dead end from the beginning...
    1. First of all, I'm not working with a network share on a NAS or SAN storage. The files are on the local disk drive where Windows is installed, so that's a DAS for you.
    2. I don't have SFU! Well obviously, I'm on Windows Vista! So that means SUA!
    3. SUA are service components only. No server components. Can you guess what that means? Yeah... no "Server for NFS" since it's a server component.
    4. Windows Vista is a client side operating system! Server for NFS is only offered for use with Windows Server systems.
    5. Back to square one!
    So there you have it. They all lived happy for the rest of their lives...
    I'm stuck here. Can someone tell me what to do? I mean beyond the obvious option to use Linux to fixa a Windows problem? The NTFS file system itself supports colons in file names. It's Windows that doesn't, and so by default it proclaims it invalid character.
    Surely, even a Windows client operating system like Windows Vista should be able to allow the user to at least rename files with invalid characters to something more sensible (from the system point of view) and valid, if not being able to open them as they
    are. Just add some crazy voodoo code to it and it will work. If you can make it possible on Windows Server with UNIX user-mode subsystem on NT kernel, then what's stopping you from giving the Windows client system the same benefit?
    So what now? Purchase a Windows Server 2012 R2 license, copy my invalid files to a NAS share with NFS on a UNIX or Linux system, and have a go at the Windows registry and Server for NFS? Yeah... you're right, it's probably a bit over the top...
    On a second thought... I might as well install Linux again. There are countless situations where Linux has helped me solve problems related to, and more often than not caused by Windows.

    Essentially, Linux created some files with colons (:) in the name on a NTFS partition where I have Windows installed. I have since uninstalled Linux, but now I can only view these files in Windows Explorer. I can't open them, I can't even rename them to
    correct the problem. It's as if they don't exist, because of the invalid search paths.
    If I try to rename them in Windows Explorer I get following message.
    The file name you specified is no valid or too long.
    Specify a different file name.
    Well isnt' that something?... isn't that nice? Windows is able to display these files, but it doesn't allow me to open them and it certainly doesn't like me to rename them. So why is it whining about it then, when I'm trying to help? It says "try a different
    file name". Yeah, right! Like I haven't tried that one already! It doesn't matter what file name I input it will never accept it.
    So what am I supposed to do now? Ditch Windows and go back to Linux? Surely, Microsoft doesn't like the sound of that. Sure, I could reinstall Linux or run a Linux live system to correct the problem. But what good is Windows then? I might as well switch to
    Linux altogether.
    After doing some research I now know by fact that it's (kind of) possible to rename files from UNIX and UNIX-like operating systems to those compliant with Windows by using something called file name character translation. To some level this is essential and
    necessary for Windows interoperability with other operating systems (Windows is not the only operating system in the world). But this seems to be very complicated and I can't get my head around it. My brain is in overload. I don't know where to start.
    Once there was a...
    There's the Windows Services for UNIX (SFU) 1.0, 2.0, 3.0, 3.5. The first two versions were based on MKS Toolkit, a package licensed by Microsoft from MKS Inc. The later versions were based on the similar Interix product, after Microsoft purchased the company
    that made it.
    Then there's the new Subsystem for UNIX-based Applications (SUA). These are services for UNIX components. They are supposed to have Client for NFS v3 included as well. But the server components from the SFU line is missing (e.g. Server for NFS). These are included
    in Server editions of Windows.
    Then there's the Microsoft Knowledge Base article
    289627: "How to Enable File Name Character Translation". This article seems to describe exactly my situation.
    Windows and UNIX operating systems have restrictions on valid characters that can be used in a file name. The list of illegal characters for each operating system, however, is different. For example, a UNIX file name can use a colon (:), but a Windows
    file name cannot use a colon (:). If a UNIX user attempts to create a file with a Windows illegal character on a Windows Services for UNIX network file system (NFS) share, the attempt is unsuccessful and the UNIX client computer receives an input or output
    error.
    It goes further than that. At first glance, this KB article also seems to offer a solution to this exact problem, with examples as shown below.
    For example, the following maps the UNIX colon (:) to a Windows dash (-):
    0x3a : 0x2d ; replace client : with - on server
    I checked these values in charmap.exe and they are correct. Except for 2D not being a "dash", it's rather a hyphen ("hyphen minus" to be exact), but these two have pretty much the same appearance and they get interchanged a lot, I'm sure
    they are used to it by now. (Yes, the characters! They don't mind.)
    Then there's this registry key.
    HKEY_LOCAL_MACHINE\Software\Microsoft\Server For NFS\CurrentVersion\Mapping
    Well, of course, I don't have Server for NFS. So this is a dead end. Well, actually, it was a dead end from the beginning...
    1. First of all, I'm not working with a network share on a NAS or SAN storage. The files are on the local disk drive where Windows is installed, so that's a DAS for you.
    2. I don't have SFU! Well obviously, I'm on Windows Vista! So that means SUA!
    3. SUA are service components only. No server components. Can you guess what that means? Yeah... no "Server for NFS" since it's a server component.
    4. Windows Vista is a client side operating system! Server for NFS is only offered for use with Windows Server systems.
    5. Back to square one!
    So there you have it. They all lived happy for the rest of their lives...
    I'm stuck here. Can someone tell me what to do? I mean beyond the obvious option to use Linux to fixa a Windows problem? The NTFS file system itself supports colons in file names. It's Windows that doesn't, and so by default it proclaims it invalid character.
    Surely, even a Windows client operating system like Windows Vista should be able to allow the user to at least rename files with invalid characters to something more sensible (from the system point of view) and valid, if not being able to open them as they
    are. Just add some crazy voodoo code to it and it will work. If you can make it possible on Windows Server with UNIX user-mode subsystem on NT kernel, then what's stopping you from giving the Windows client system the same benefit?
    So what now? Purchase a Windows Server 2012 R2 license, copy my invalid files to a NAS share with NFS on a UNIX or Linux system, and have a go at the Windows registry and Server for NFS? Yeah... you're right, it's probably a bit over the top...
    On a second thought... I might as well install Linux again. There are countless situations where Linux has helped me solve problems related to, and more often than not caused by Windows.

Maybe you are looking for

  • How do I get rid of Pages 5

    I really dislike some of the changes to Pages. Before, I pulled up a report, made my changes, clicked "save as" and checked "make a Windows compatible copy" I typed in the new name and I was finished. Now - I pull up a report, make my changes. Have t

  • Tcode to find the load in server is 20 users run a particular ABAP program

    I want to find the load in the SAP Server (in terms of CPU Usage, memory usage) if a particular Query or ABAP program is executed by 20 users. Pls let me knwo the Tcode for the same As per my understanding ST03 can be used to view the report of previ

  • Changing the Text Cursor for all Text Components

    Hi, The users have asked me to change the text cursor i.e, the vertical cursor for all the text components in our application. Is there a common way to change it , without having to call the setCaret method for each of the text components ? I saw tha

  • Why did I have to enter IP address manually

    I could use a little help. I have an Airport Extreme 802.11n and a Motorola modem for connecting to Comcast. I also have two Macs and an iPhone. All of this was working fine up until very early this morning. And then it just stopped working. After tr

  • Adobe Premiere Pro CS5 Glitchy Export!

    I export from Premiere Pro and the export comes out all glitchy! I have no idea why. Also the export plays back fine in Priemere. This video will explain everything a whole lot better. http://www.youtube.com/watch?v=NVGChtOT0zY I have researched this