Loading ...
Sorry, an error occurred while loading the content.

file.delete(filenamex)

Expand Messages
  • russellgum
    when I have the line of code file.delete(filenamex) where filenamex is the path to a file Frontier deletes the file as expected but terminates my script which
    Message 1 of 3 , Jun 14, 2008
    • 0 Attachment
      when I have the line of code
      file.delete(filenamex)
      where filenamex is the path to a file Frontier deletes the file as expected but terminates my
      script which is not expected. In debug mode it just jumps to the Run Debug Compile mode
      without stepping through the code lines below the file.delete line. I did a backup of all of my
      roots and replaced the origionals with the backups after removing the .22 etc from .root.22.
      I also replaced the app with a clean copy. I still get the same problem.

      Is a backup from Frontier the same as Saving a copy? If not then I can see if saving a copy
      will get rid of the problem. Otherwise I am at a loss to explain the problem. This code has
      been working for several years on my server running Radio but I need to move to Frontier to
      take advantage of the new features.

      Russ
    • creecode
      Hello Russ, ... expected but terminates my ... Debug Compile mode ... If I understand the problem, in the code below you d never get to the dialog.alert line?
      Message 2 of 3 , Jun 14, 2008
      • 0 Attachment
        Hello Russ,

        --- In frontierkernel@yahoogroups.com, "russellgum" <russgum@...> wrote:
        >
        > when I have the line of code
        > file.delete(filenamex)
        > where filenamex is the path to a file Frontier deletes the file as
        expected but terminates my
        > script which is not expected. In debug mode it just jumps to the Run
        Debug Compile mode
        > without stepping through the code lines below the file.delete line

        If I understand the problem, in the code below you'd never get to the
        dialog.alert line?

        local {
        f = file.getSpecialFolderPath ( "", "desktop folder", false ) +
        "test.txt"};

        file.writeWholeFile ( f, "content" );

        file.delete ( f );

        dialog.alert ( "got here!" )

        Could you run this script and let us know if it has the same problem?
        You may need to adjust the getSpecialFolder if you're on Windows. If
        you can give us a test case that demonstrates the problem with a
        simple test case. You can use the above script as a starting point.

        What version of the app are you running?

        Please take a look at <
        http://sourceforge.net/tracker/index.php?func=detail&aid=1533295&group_id=120666&atid=687798
        > and add any information that my help diagnose the problem. To tell
        the truth I don't recall if I found a resolution to the problem that I
        mentioned but I'm willing to get back on top of it if I can reproduce
        your problem.

        > I can see if saving a copy
        > will get rid of the problem.

        I don't think saving a copy will help much here.

        > Otherwise I am at a loss to explain the problem. This code has
        > been working for several years on my server running Radio but I need
        to move to Frontier to
        > take advantage of the new features.

        The file code has been updated in recent copies Frontier so that could
        explain the difference between Radio and Frontier and possibly the bug.

        Toodle-loooooooooooo........
        creecode
      • russellgum
        oK I found the problem (maybe) Your code works fine. My code was in a try statement where I assumed that it would fail if the file was not present. Instead of
        Message 3 of 3 , Jun 14, 2008
        • 0 Attachment
          oK I found the problem (maybe)

          Your code works fine.

          My code was in a try statement where I assumed that it would fail if the file was not
          present. Instead of failing it just terminated the script without any error message. I can
          program around this by checking if the file exists instead of using the try statement.



          this script never gets to the "got here again" on my machine.

          local (f);
          f = file.getSpecialFolderPath ( "", "desktop folder", false ) + "test.txt";
          file.writeWholeFile ( f, "content" );
          file.delete ( f );
          dialog.alert ( "got here!" );

          try {
          file.delete ( f );
          dialog.alert ( "got here again!" );
          };

          Thanks again Russ

          --- In frontierkernel@yahoogroups.com, "creecode" <creecode@...> wrote:
          >
          > Hello Russ,
          >
          > --- In frontierkernel@yahoogroups.com, "russellgum" <russgum@> wrote:
          > >
          > > when I have the line of code
          > > file.delete(filenamex)
          > > where filenamex is the path to a file Frontier deletes the file as
          > expected but terminates my
          > > script which is not expected. In debug mode it just jumps to the Run
          > Debug Compile mode
          > > without stepping through the code lines below the file.delete line
          >
          > If I understand the problem, in the code below you'd never get to the
          > dialog.alert line?
          >
          > local {
          > f = file.getSpecialFolderPath ( "", "desktop folder", false ) +
          > "test.txt"};
          >
          > file.writeWholeFile ( f, "content" );
          >
          > file.delete ( f );
          >
          > dialog.alert ( "got here!" )
          >
          > Could you run this script and let us know if it has the same problem?
          > You may need to adjust the getSpecialFolder if you're on Windows. If
          > you can give us a test case that demonstrates the problem with a
          > simple test case. You can use the above script as a starting point.
          >
          > What version of the app are you running?
          >
          > Please take a look at <
          > http://sourceforge.net/tracker/index.php?
          func=detail&aid=1533295&group_id=120666&atid=687798
          > > and add any information that my help diagnose the problem. To tell
          > the truth I don't recall if I found a resolution to the problem that I
          > mentioned but I'm willing to get back on top of it if I can reproduce
          > your problem.
          >
          > > I can see if saving a copy
          > > will get rid of the problem.
          >
          > I don't think saving a copy will help much here.
          >
          > > Otherwise I am at a loss to explain the problem. This code has
          > > been working for several years on my server running Radio but I need
          > to move to Frontier to
          > > take advantage of the new features.
          >
          > The file code has been updated in recent copies Frontier so that could
          > explain the difference between Radio and Frontier and possibly the bug.
          >
          > Toodle-loooooooooooo........
          > creecode
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.