Hey all, i have an application suite where it needs to manage a queue of files between two applications. The player is playing all the files in a directory, while the updater may add or remove files to it based on a CRON Schedule...
the problem becomes when coincidentally, i need to delete a file while the player is using it. Of course i need to wait till the player is done, but there is no DeleteLater... One thought was to just add the file names that fail to remove to another Queue, to go back and try them again, but before i go though all that i wanted to see if there was another reason.
Here is the simple function i am using... Pseudo-code.
Qt Code:
if (dir.exists(mediafile)) { // TODO: How to handle if the file is in use. if(dir.remove(mediafile)) { // "file removed"; } else { // "unable to remove the file"; } } else { // "In path:" << dir.path(); // "unable to find the mediafile: " << mediafile; }To copy to clipboard, switch view to plain text mode
Bookmarks