Welcome Guest, Not a member yet? Register   Sign In
Why doesn't the file helper have a function that will delete a single file?
#1

[eluser]skunkbad[/eluser]
Yes, I saw the discussion on Bitbucket. Yes, there is a native function. It would be nice if delete_files() was edited so that it could delete a file if the argument was not a directory. Yes, we can just extend the helper if we want... and yes there are more important things to do.
#2

[eluser]mddd[/eluser]
If you change the helper to function that way, I would think it could be absorbed into the CI release version?
#3

[eluser]danmontgomery[/eluser]
The php function to delete a file is unlink()
#4

[eluser]skunkbad[/eluser]
[quote author="noctrum" date="1271269059"]The php function to delete a file is unlink()[/quote]

Yes, of course. I just think it would be nice if delete_files() could handle anything. A single file, an array of files, or a directory as it does now.
#5

[eluser]Linderman[/eluser]
The CI helper functions are usable when for the same task you must write 5+ rows of pure php code , instead of 1 row with CI. And as u can see the unlink is short enough Wink Dont think there is need of something else for the unlink ... and its shorter than delete_files() Tongue
#6

[eluser]nelson.wells[/eluser]
Even so, I see the point he is trying to make. delete_files() sounds like it should be able to delete a single file, so semantically, I think it should. What are the odds a small change like this could be added to to the core if it were forked, added, and pull request-ed on BitBucket?




Theme © iAndrew 2016 - Forum software by © MyBB