PDA

View Full Version : Deleting files from Harddisk


Buexe
05-23-2003, 02:21 PM
hi everybody, I would like to delete certain files on my harddisk via a mel user interface. These files are created by a mel script and then get listed in a textscroll list window. If I just open the window with the list, it lists all previously created files and I can delete one if I don`t need it anymore. But when I create a new file with the script and want to delete one (even one of the old ones ) afterwards nothing happens. I guess it happens because Maya keeps some kind of connections to the files after the creation script.

To delete the files I create a command line:
system ("del /F c:\example.file" );

If I execute this command in the shell while Maya is open, I get an error message that the file is in use by another application (Maya)

anybody has a hint?
TIA
Buexe

bigfatMELon
05-26-2003, 11:36 PM
If the example file was created by mel then perhaps it hasn't ever been closed. This would keep it marked as busy and make it not deletable.

-jl

mark_wilkins
05-27-2003, 03:59 AM
Assuming you're creating these files with fopen:

are you using the fclose command to close the file before you're attempting to delete it? If not, you should!

-- Mark

Buexe
05-27-2003, 10:36 AM
The creation-mel did not lack a fclose command but one of the reading mels did. Maybe a little more systematic testing would have gotten me earlier to the error.

Thanks guys!:beer:
buexe

CGTalk Moderation
01-15-2006, 05:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.