Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

unremovable directory

Name: Anonymous 2011-01-06 5:39

so I have this NTFS partition and like it is on my laptop
my laptop is my dev box. It's mobile, and great for development for boring times from my computer (like at work). I know a dev environment should be considered unstable, but I have grown to actually love this particular partition. It is the one that was already preinstalled from fucking 2006 or so it's the original. One day I was programming and created a directory using the windows API and like made a directory with invalid characters and now it's all fucked up. I can't delete it. Windows refuses to fucking read it. I think it is "text.txt \0". It gets even more fucked up as I make a text file called "text.txt". When I do, I can delete the fucked up directory BUT the text file rebecomes the directory again! I can save files to it but when I delete it in the manner of creating a new text document the file inside BECOMES LOST or get deleteded. I don't know. What do I do?

Name: Anonymous 2011-01-06 5:57

Did you try to programmatically delete it using Windows API calls in a process running with administrator privileges? Try that.

Name: Anonymous 2011-01-06 5:58

Did you run scandisk? It can fix corrupted file allocation tables.

Name: Anonymous 2011-01-06 6:05

>>1
Try reboot =)=)=) xD

Name: Anonymous 2011-01-06 6:26

>>2
did once through the same loop but nothing happens.  That may not be the correct text string but only what windows shows as the file.  I plan on to play with it till I do some how delete it by reading through the directory with the API ("CreateDirectory(" and "DeleteDirectory(" was used).
>>3
full scan nothing happened or reproted

Name: Anonymous 2011-01-06 6:29

cmd del text.* or text.txt? or text.txt  has no output what so ever as if it was deleted but yet the dir remains

Name: Anonymous 2011-01-06 6:30

Delete system32

Name: Anonymous 2011-01-06 6:40

>>5
Use the Windows API stuff to enumerate the parent directory. You'll get back the correct string, but also the file handle for the directory. Use the file handle to try to forcefully delete it. Trying to delete it by name with a string is probably where it's fucking up.

Name: Anonymous 2011-01-06 6:43

>>8
Sorry, just looked, you can't delete by file handle. But still, should try enumerating it to get correct name. Use FindFirstFileEx and FindNextFile to enumerate the parent directory. http://msdn.microsoft.com/en-us/library/aa364419%28v=vs.85%29.aspx

typedef struct _WIN32_FIND_DATA {
  DWORD    dwFileAttributes;
  FILETIME ftCreationTime;
  FILETIME ftLastAccessTime;
  FILETIME ftLastWriteTime;
  DWORD    nFileSizeHigh;
  DWORD    nFileSizeLow;
  DWORD    dwReserved0;
  DWORD    dwReserved1;
  TCHAR    cFileName[MAX_PATH];
  TCHAR    cAlternateFileName[14];
} WIN32_FIND_DATA, *PWIN32_FIND_DATA, *LPWIN32_FIND_DATA;

Try deleting it with both cFileName and cAlternateFileName.

Name: sage 2011-01-06 7:49

sage

Name: Anonymous 2011-01-06 8:50

Use the *W APIs or if that isn't enough, use the NTAPI. There's actually applications which can locate/rename/delete files with null's in their names (it's a common "exploit" used by some malware which make files using the NT API which are not readable using normal Win32 APIs as those expect strings to be null-terminated like in C).

Name: Anonymous 2011-01-08 0:30

as an update RemoveDirectory fixed everything for me and now I am happy!

Don't change these.
Name: Email:
Entire Thread Thread List