1lann / Mimic

A fully featured emulator for the Minecraft mod ComputerCraft that runs straight in your browser.
gravlann.github.io
MIT License
45 stars 20 forks source link

FS API discrepancies #51

Open 1lann opened 10 years ago

1lann commented 10 years ago

gamax92:

fs.delete will give "Access denied" rather then "Access Denied" fs api doesn't check for Invalid paths, like ".." or "../something" fs.move("f","f\a") will succeed and the folder is lost, CC will error "Can't move a directory inside itself" fs.copy("f","f\a") will succeed and nothing happens, CC will error "Can't copy a directory inside itself" fs.move will succeed if the first path doesn't exist, CC will error "No such file" fs.move will succeed if the second path exists and do nothing, CC will error "File exists" fs.copy will succeed if the first path doesn't exist, CC will error "No such file" fs.copy will succeed if the second path exists and do nothing, CC will error "File exists" fs.copy("rom","rom") will succeed, CC will error "Access denied" (Yes, denied is supposed to be lowercase) fs.move("rom","sdfs") will crash the emulator, CC will error "Access denied" fs.move("rom","rom") will succeed, CC will error "Access denied" fs.makeDir will succeed on files, CC will error "File exists" fs.makeDir will succeed on "rom" or "rom/sda" and do nothing, CC will error "Access Denied" fs.getFreeSpace returns nothing fs.getSize always returns 2097152 fs.getDrive does nothing fs.getName should give "root" if the name is "" fs.list crashes the emulator if a file is specified fs.find doesn't clean paths when cleaning paths, the following characters are dropped: ":<>?| Incase there is confusion, thats double quote, colon, left triangle bracket, right triangle bracket, question mark, and pipe fs.getDir should give ".." if the name is "" when cleaning paths, if your piece is ".." and the stack is empty or the last piece is also a "..", then add it to the stack fs.find("*") is not adding "rom"