Bug #565 xASL_adm_DeleteFileList symlink#667
Conversation
jan-petr
left a comment
There was a problem hiding this comment.
Why do we use the delete function instead of calling xASL_delete one by one in the first place? Is that significantly faster?
If you call |
|
@HenkMutsaerts: Should I just check if I can delete a list of files and if that works it's okay? Or does this require more extensive testing? |
MichaelStritt
left a comment
There was a problem hiding this comment.
Removing files seems to work and is fast, but the file list that is returned is empty?
>> pathTest = '.\testFolderToRemove';
>> testFiles = xASL_adm_GetFsList(pathTest, '^.+\.exe$');
>> testFiles
testFiles =
1×8 cell array
{'myFile (1).exe'} {'myFile (2).exe'} {'myFile (3).exe'} {'myFile (4).exe'}
{'myFile (5).exe'} {'myFile (6).exe'} {'myFile (7).exe'} {'myFile (8).exe'}
>> removedFiles = xASL_adm_DeleteFileList(pathTest, '^.+\.exe$');
>> removedFiles
removedFiles =
0×0 empty char array
Yes. I understand why I am simply looking for the motivation to try lines 66-67 and not going right away for solution on line 68-79? Is that faster? |
|
Yes, delete is faster, that was the only motivation for the try |
OK. That's a satisfactory answer :) |
DevelopTest without space in pathTest with space in pathFeature branchTest without space in pathTest with space in pathConclusion@HenkMutsaerts: Seems like this bug is not in develop and is not related to spaces in file names. |
|
@MichaelStritt can you retest? I indeed reinitialized the output value |
There was a problem hiding this comment.
Seems to work now 👍
>> pathWithoutSpaces = '.\Server_xASL\testtest';
>> [deletedFiles,NotDeletedFiles] = xASL_adm_DeleteFileList(pathWithoutSpaces, '^.+$')
deletedFiles =
4×1 cell array
{'.\Server_xASL\testtest\Git-2.32.0-64-bit - Kopie (2).exe' }
{'.\Server_xASL\testtest\Git-2.32.0-64-bit - Kopie - Kopie.exe'}
{'.\Server_xASL\testtest\Git-2.32.0-64-bit - Kopie.exe' }
{'.\Server_xASL\testtest\Git-2.32.0-64-bit.exe' }
NotDeletedFiles =
0×0 empty char array
>> pathWithSpaces = '.\Server_xASL\test test';
>> [deletedFiles,NotDeletedFiles] = xASL_adm_DeleteFileList(pathWithSpaces, '^.+$')
deletedFiles =
4×1 cell array
{'.\Server_xASL\test test\Git-2.32.0-64-bit - Kopie (2).exe' }
{'.\Server_xASL\test test\Git-2.32.0-64-bit - Kopie - Kopie.exe'}
{'.\Server_xASL\test test\Git-2.32.0-64-bit - Kopie.exe' }
{'.\Server_xASL\test test\Git-2.32.0-64-bit.exe' }
NotDeletedFiles =
0×0 empty char array
MichaelStritt
left a comment
There was a problem hiding this comment.
So the deleted files list seems to work, the other one seems to be bugged though. Check out my UnitTest. You should be able to run it pretty easily.
MichaelStritt
left a comment
There was a problem hiding this comment.
Sorry, I should have read the header more carefully. I thought pathsNotDeleted would be the paths in the directory that weren't deleted. You describe it correctly though 👍
Filelists are now also deleted file-by-file, checked again if all files are deleted, and warnings about deleting a non-existing file are suppressed. This helps e.g., with a repetition of the identical file in the same list, e.g., in the case of symlinks
b87f04a to
464d43e
Compare
Linked issue
Closes #565
Notes for reviewing
Please check the issue, thanks!