User Tag List

Results 1 to 10 of 10

Thread: How to delete a single file

  1. #1
    Clicker Fusion 2.5

    Join Date
    Oct 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to delete a single file

    Hi, I'm stuck again with another simple task
    Trying to delete a single file.
    I have a folder =Appdrive$+Appdir$+"1"
    I have loaded the folder contents into a listbox
    I created a delete button so the user can delete a selected file from the list.
    Have tried several different versions, this example makes sense to me but dosn't work
    file actions----delete file----Appdrive$+Appdir$+"1\"+List Select$( "List" )
    listbox----delete a line---List Select( "List" )
    listbox---reset
    listbox---load filelist-----Appdrive$+Appdir$+"1"

    So I tried other ways to delete file to experiment with it, but no results.., like this
    file actions----delete file---"C:\Notetaker\testfile.rtf" dosn't work

    So I did a search and found "the Delete Files" example in this forum.
    This method works great for deleting ALL files in a folder, but the command works by looping
    through all files and deleting them. I can't translate it to just remove a single file.

    There was an example using the console, but I'm not familiar with it, and wish to avoid the console.

    I don't know. Is it because my filelist is already loaded into the listbox?

    So My Question is.
    What is the correct procedure for deletion of a single file?

  2. #2
    Forum Moderator Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Sphax's Avatar
    Join Date
    Jun 2006
    Location
    Paris, France
    Posts
    4,454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to delete a single file

    Try to use the FIle-Folder object.

  3. #3
    Clicker Fusion 2.5

    Join Date
    Oct 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to delete a single file

    Thanks for the tip, but I don't get it.
    I've already used the file-folder to get the contents in the list.






  4. #4
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to delete a single file

    The path is incorrect somehow, or your computer doesn't allow it to happen?

    Try using the file object? It can delete files with ease.

  5. #5
    Clicker Fusion 2.5

    Join Date
    Oct 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to delete a single file

    No , the path is correct.
    Even tryng a simple path like:
    file actions----delete file---"C:\Notetaker\testfile.rtf" dosn't work
    Yes, The cpu dosn't allow it to happen.
    And,I am using the file object.
    Yes,It can delete files with ease, as I saw in the "Delete Files" example.
    But I want to delete a single file, and so far this can't be done.

    Is this possible in MMF2?

    Maybe if someone can try this on thier cpu and tell me what results they get:
    create folder on (C:\Testfolder)
    put a file in it (C:\Testfolder\Testfile.txt)
    then
    File actions-delete file-"C:\Testfolder\Testfile.txt"

    I get no results when in theory it should work

  6. #6
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to delete a single file

    It has been working fine for me. Upload a zip with the file and Mfa?

  7. #7
    Clicker Fusion 2.5

    Join Date
    Oct 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to delete a single file

    Jeez, I’ve just tried my delete test and this time I got a result. I didn’t change a thing either. The only thing I can think of is that the file was still held in memory somehow when I was trying to delete(if that’s possible, I don’t know)

    Anyway, I CAN delete a file now. I can move back up to my original problem now-still dosn't work
    Deleting a file from a list-still dosn't work.
    here is the whole program zipped up
    (when opened, you’ll see a few notes I’ve written to give you “heads up” so you don’t waste to much time on it.)
    https://secure.storegate.com/user/share.aspx?id=3d10abaa-e059-41f6-8808-38d8a6820354

    Thanks for all the help

  8. #8
    Clicker Fusion 2.5

    Join Date
    Oct 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to delete a single file

    Yehhh. GOT IT.
    I found the what was wrong. It was the file object itself.
    I cloned it and the new file object works perfectly. I can delete
    anything, anywhere. All good.

    I'd love to know WHY my first File object refuses to delete anything. Got me baffled? I'll keep the link active for a while
    Thanks again

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had this exact same problem. My issue was I had the following code:

    Run once
    - create a directory in my AppData folder to store program-related

    The problem was, if this directory already existed it would break the File extension, preventing it from doing further functions (like delete files).

    The fix is:
    Name exists (AppData folder + new folder to be created) NEGATE
    - create a directory in my AppData folder to store program-related

    This ensures the folder only creates if it doesn't exist, which doesn't break the extension for future use.

  10. #10
    Clicker Fusion 2.5 DeveloperInstall Creator Pro

    Join Date
    Sep 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please read the documentation, the file object will block all operations on files and folders when an error has occured and until the error is not cleared.

    Performing some system operations without checking if any error arised is a really bad practice! In fact, when possible, handle potential errors all the time and everywhere! When something may goes wrong, you need to have some kind of information about what happened and where. If you don't handle the error, keep a trace or warn the user about it, you will hardly be able to debug your application afterwards.

Similar Threads

  1. How to delete single instance of an object
    By liquiddil in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 26th October 2013, 02:04 AM
  2. delete a file??
    By Sevennemesis in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 20th June 2012, 04:07 AM
  3. Delete external file AND check if file exists
    By Renatos in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 16th August 2011, 03:39 PM
  4. [Request]Packing multi files to single file
    By ASD in forum Extension Development
    Replies: 5
    Last Post: 5th July 2011, 11:52 AM
  5. How to delete data from INI file properly?
    By bearcub in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 20th December 2007, 08:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •