Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-2226

Filesystem file.rename() is not working on iOS

    Details

      Description

      {html}<div><p>Using the following code, file.rename is not working.</p>
      <p>var win = Ti.UI.currentWindow;</p>
      <p>var f =
      Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory,
      'a.txt');</p>
      <p>var newFile =
      Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'newfile.txt');<br>
      newFile.write(f.read());</p>
      <p>newFile.rename('b.txt');</p>
      <p>var renamed =
      Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'b.txt');<br>
      Ti.API.info(renamed.exists());</p>
      <p>var file_tf = Titanium.UI.createTextField({<br></p> <pre> <code>color:'#336699', height:35, top:0, left:0, width:320, value:renamed.read()</code> </pre> <p>});</p>
      <p>win.add(file_tf);</p>
      <p>This is tested against 4.1 and 1.5</p></div>{html}

        Attachments

          Activity

            People

            • Assignee:
              blainhamon Blain Hamon
              Reporter:
              ctredway1 ctredway
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-1963
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration