To delete gunziped file
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Pooja
el 2 de Sept. de 2014
I am using gunzip to get the unzipped file from .gz file. I need that I get data from the unzipped file and don't get a copy of unzipped file. This is because unzipped file take a lot of space and I have 1000s of such file. i.e. I want to delete the unzipped file as soon as I get required data from it. OR Is there any way to get only required data from .gz file.
Thanks in advance Pooja
2 comentarios
Stephen23
el 2 de Sept. de 2014
But it is not clear what you are actually trying to do. Are you doing this in a loop? In what form is your list of filenames? Do you generate the filenames on the fly? Where are the files located?
We need to know a bit more about what you are doing, in order to have an idea of how to solve your problem.
Please read this advice on how to write a question that will make it easier for people to help you, then edit your question to provide a minimum working example of your code.
Respuesta aceptada
Guillaume
el 2 de Sept. de 2014
You need to close the file before deleting it. Write
fclose(file);
before
delete(file);
2 comentarios
Stephen23
el 2 de Sept. de 2014
Editada: Stephen23
el 2 de Sept. de 2014
It is a good idea to keep fopen and fclose calls very close to each other, to avoid eaxctly this kind of problem: basically as soon as you write fopen you should write the following fclose too. And keep only the bare minimum amount of code in between, usually reading/writing whatever data is required.
Note that fclose('all') could cause problems if this function is called from another function that has and requires an open file...
Más respuestas (0)
Ver también
Categorías
Más información sobre JSON Format en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!