help with removing a file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

help with removing a file

Mariano Martinez Peck
Hi folks. I don't want other than green tests in dev images, thus, I started to fix them as much as possible. There are a lot of failing tests of Nile (only fail in windows). The test is NSCompressedSourceStreamTest  and I noticed something weird.  If you look to tearDown method, it tries to remove two files that it actually were created in the setUp method.

But it is weird because it tries to remove a file that actually exist and it is not being removed.

If I debug in DosFileDirectory >> deleteFileNamed: localFileName ifAbsent: failBlock

everything looks ok, but the file is not removed and the failBlock is executed :(

localFileName ->  'testCompressedSourceStream.stc'

(self fullNameFor: localFileName) asVmPathName  -> 'C:\mariano\squeak\imagenes\Pharo1.0-10508-rc2dev10.01.2\testCompressedSourceStream.stc'

And that file exist, as you can see in screenshot that I attach.

Can someone help me with this ?

Cheers

Mariano

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Picture 2.png (100K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] help with removing a file

johnmci
I *think* you can run into problems if your evil windows virus package has the file OPEN has it's trying to figure out which of the 100 million viruses could exist in the file. 
This can cause your delete to fail.  Maybe you have to wait 1000 milliseconds? for Norton to catch up? 

The windows code runs the following code, and there is a FAIL check  to see if there is a duplicate file name based on case sensitivity. 

sqInt sqFileDeleteNameSize(char* fileNameIndex, sqInt fileNameSize) {
  WCHAR win32Path[MAX_PATH+1];
  int sz;
  /* convert the file name into a null-terminated C string */
  sz = MultiByteToWideChar(CP_UTF8, 0, fileNameIndex, fileNameSize, NULL, 0);
  if(sz > MAX_PATH) FAIL();
  MultiByteToWideChar(CP_UTF8, 0, fileNameIndex, fileNameSize, win32Path, sz);
  win32Path[sz] = 0;
  if(hasCaseSensitiveDuplicate(win32Path)) FAIL();
  if(!DeleteFileW(win32Path)) FAIL();
  return 1;
}



On 2010-01-25, at 2:07 PM, Mariano Martinez Peck wrote:

Hi folks. I don't want other than green tests in dev images, thus, I started to fix them as much as possible. There are a lot of failing tests of Nile (only fail in windows). The test is NSCompressedSourceStreamTest  and I noticed something weird.  If you look to tearDown method, it tries to remove two files that it actually were created in the setUp method.

But it is weird because it tries to remove a file that actually exist and it is not being removed.

If I debug in DosFileDirectory >> deleteFileNamed: localFileName ifAbsent: failBlock

everything looks ok, but the file is not removed and the failBlock is executed :(

localFileName ->  'testCompressedSourceStream.stc'

(self fullNameFor: localFileName) asVmPathName  -> 'C:\mariano\squeak\imagenes\Pharo1.0-10508-rc2dev10.01.2\testCompressedSourceStream.stc'

And that file exist, as you can see in screenshot that I attach.

Can someone help me with this ?

Cheers

Mariano
<Picture 2.png>_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================





_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] help with removing a file

Mariano Martinez Peck


2010/1/26 John M McIntosh <[hidden email]>
I *think* you can run into problems if your evil windows virus package has the file OPEN has it's trying to figure out which of the 100 million viruses could exist in the file. 
This can cause your delete to fail.  Maybe you have to wait 1000 milliseconds? for Norton to catch up? 


Thanks John for the tip, but I don't have any antivirus or similar installed :(


 
The windows code runs the following code, and there is a FAIL check  to see if there is a duplicate file name based on case sensitivity. 

sqInt sqFileDeleteNameSize(char* fileNameIndex, sqInt fileNameSize) {
  WCHAR win32Path[MAX_PATH+1];
  int sz;
  /* convert the file name into a null-terminated C string */
  sz = MultiByteToWideChar(CP_UTF8, 0, fileNameIndex, fileNameSize, NULL, 0);
  if(sz > MAX_PATH) FAIL();
  MultiByteToWideChar(CP_UTF8, 0, fileNameIndex, fileNameSize, win32Path, sz);
  win32Path[sz] = 0;
  if(hasCaseSensitiveDuplicate(win32Path)) FAIL();
  if(!DeleteFileW(win32Path)) FAIL();
  return 1;
}



On 2010-01-25, at 2:07 PM, Mariano Martinez Peck wrote:

Hi folks. I don't want other than green tests in dev images, thus, I started to fix them as much as possible. There are a lot of failing tests of Nile (only fail in windows). The test is NSCompressedSourceStreamTest  and I noticed something weird.  If you look to tearDown method, it tries to remove two files that it actually were created in the setUp method.

But it is weird because it tries to remove a file that actually exist and it is not being removed.

If I debug in DosFileDirectory >> deleteFileNamed: localFileName ifAbsent: failBlock

everything looks ok, but the file is not removed and the failBlock is executed :(

localFileName ->  'testCompressedSourceStream.stc'

(self fullNameFor: localFileName) asVmPathName  -> 'C:\mariano\squeak\imagenes\Pharo1.0-10508-rc2dev10.01.2\testCompressedSourceStream.stc'

And that file exist, as you can see in screenshot that I attach.

Can someone help me with this ?

Cheers

Mariano
<Picture 2.png>_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================





_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project