Bedrock File

Discussion in 'Plugin Development' started by Juancomaster1998, Dec 6, 2014.

Thread Status:
Not open for further replies.
  1. Hi!
    I`ve made a mistake on my plugin and created a file "asdsa ", without extension. So now I can not delete it, I tried anything, I tried some tutorials on youtube and google, but nothing, Is there a way to delete it thru the plugin? thanks
     
  2. Offline

    xTrollxDudex

    Juancomaster1998
    Define "can not delete it", is it being used? Is it a protocol error? Have you used the command line? What have you tried?
     
  3. "can not delete it" = says me the file doesn`t exist when I try to delete it, I can`t oppen it coz it`s an empty file without any extension, I tried some tips on yt and google but them seem not to work.
    The plugin created a file with the last line of a sign. I used "asdsa :3", so it created the file "asdsa ", I need to forbid the use of spaces... xD
     
  4. Offline

    xTrollxDudex

    Juancomaster1998
    Have you tried using the command line? What OS platform are you using?
     
  5. Offline

    Skionz

    Juancomaster1998 try this
    Code:
    File file = new File("asdsa ");
    file.delete();
     
  6. Thanks, I`ll try it!

    Windows
     
  7. Offline

    Gingerbreadman

    Juancomaster1998 you can also just refresh your desktop (restart if you dont know how to refresh) because the file dosent exist!
     
  8. well, 2 problems with that:
    1_ it isn`t the desktop, it`s on a folder on plugins/BomberCraft
    2_ I`ve tried it like 5 or 6 times.

    Code:java
    1. if (cmd.getName().equalsIgnoreCase("delfile")) {
    2. if (args.length != 1) {
    3. sender.sendMessage(ChatColor.RED + "Uso Incorrecto!");
    4. return true;
    5. }
    6. String arg0 = args[0];
    7. File file = new File(this.getDataFolder() + File.separator + "signs" + File.separator, arg0 + " ");
    8. file.delete();
    9. sender.sendMessage(ChatColor.GREEN + "Archivo eliminado exitosamente!");
    10. return true;
    11. }

    The file seems not to like being deleted...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 29, 2016
  9. Offline

    Skionz

  10. I tried checking if the file exists by "if (!file.exists()) { sender.sendMessage("File doesn`t exist) }", and no, it doesn`t exist
     
  11. Offline

    xTrollxDudex

  12. Offline

    Gingerbreadman

  13. xTrollxDudex what do u mean by Command line?

    Gingerbreadman okey, I`ll try it!

    Gingerbreadman
    sry, but it isn`t my problem, the file isn`t being using, it doesn`t exist

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 29, 2016
  14. Juancomaster1998
    I'm a little confused here. If the file doesn't actually exist, then what's the problem exactly?
     
  15. well, I can`t delete any folder that contains the file.
     
  16. Offline

    xTrollxDudex

Thread Status:
Not open for further replies.

Share This Page