[z88dk-dev] z80asm removing files not belonging to it

Bridge to the z88dk-developers mailing list
Post Reply
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

[z88dk-dev] z80asm removing files not belonging to it

Post by alvin »

Paulo, I undid this change:

Index: z80asm.c
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/z80asm/z80asm.c,v
retrieving revision 1.205
retrieving revision 1.206
diff -C2 -d -r1.205 -r1.206
*** z80asm.c 30 Jun 2016 00:26:02 -0000 1.205
--- z80asm.c 30 Jun 2016 02:12:59 -0000 1.206
***************
*** 76,85 ****

/* remove output files, except obj */
! remove(get_lst_filename(src_filename));
! remove(get_bin_filename(src_filename));
! remove(get_sym_filename(src_filename));
! remove(get_map_filename(src_filename));
! remove(get_reloc_filename(src_filename));
! remove(get_def_filename(src_filename));

/* Create error file */
--- 76,85 ----

/* remove output files, except obj */
! //remove(get_lst_filename(src_filename));
! //remove(get_bin_filename(src_filename));
! //remove(get_sym_filename(src_filename));
! //remove(get_map_filename(src_filename));
! //remove(get_reloc_filename(src_filename));
! //remove(get_def_filename(src_filename));

/* Create error file */


z80asm was erasing files it did not create. In my case, while building the new c library, it erased a number of "*.lst" files that are actually list files named *.lst that contain a list of source files to assemble into the library. They were not list files as generated by z80asm. As is, z80asm could erase user files that happen to have the same extension as z80asm generated files.



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
pscust
Well known member
Posts: 194
Joined: Thu Jun 23, 2011 3:34 pm

Post by pscust »

Sorry. I did to ensure there were no leftovers from previous z80asm runs, which happened to cause myself some confusion after some failed tests.

I will keep your change.

Anyway I would prefer to have different extensions for output list files and input lists of files, to avoid a user to loose his input file because of a coincidence in the .asm file name.

Maybe .lst and .prj?
Em 30/06/2016 03:16, "alvin (alvin_albrecht@...)" <lists@...> escreveu:
Paulo, I undid this change:

Index: z80asm.c
===================================================================
RCS file: /cvsroot/z88dk/z88dk/src/z80asm/z80asm.c,v
retrieving revision 1.205
retrieving revision 1.206
diff -C2 -d -r1.205 -r1.206
*** z80asm.c? ? ? 30 Jun 2016 00:26:02 -0000? ? ? ? ? 1.205
--- z80asm.c? ? ? 30 Jun 2016 02:12:59 -0000? ? ? ? ? 1.206
***************
*** 76,85 ****
?
? ? ? ? ? ? ? ? /* remove output files, except obj */
!? ? ? ? ? ? ? remove(get_lst_filename(src_filename));
!? ? ? ? ? ? ? remove(get_bin_filename(src_filename));
!? ? ? ? ? ? ? remove(get_sym_filename(src_filename));
!? ? ? ? ? ? ? remove(get_map_filename(src_filename));
!? ? ? ? ? ? ? remove(get_reloc_filename(src_filename));
!? ? ? ? ? ? ? remove(get_def_filename(src_filename));
?
? ? ? ? ? ? ? ? /* Create error file */
--- 76,85 ----
?
? ? ? ? ? ? ? ? /* remove output files, except obj */
!? ? ? ? ? ? ? //remove(get_lst_filename(src_filename));
!? ? ? ? ? ? ? //remove(get_bin_filename(src_filename));
!? ? ? ? ? ? ? //remove(get_sym_filename(src_filename));
!? ? ? ? ? ? ? //remove(get_map_filename(src_filename));
!? ? ? ? ? ? ? //remove(get_reloc_filename(src_filename));
!? ? ? ? ? ? ? //remove(get_def_filename(src_filename));
?
? ? ? ? ? ? ? ? /* Create error file */


z80asm was erasing files it did not create.? In my case, while building the new c library, it erased a number of "*.lst" files that are actually list files named *.lst that contain a list of source files to assemble into the library.? They were not list files as generated by z80asm.? As is, z80asm could erase user files that happen to have the same extension as z80asm generated files.



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
Post Reply