Cannot rename a file

R

roger

I have an application which transfers files from portable usb device to
hard disk.
Once in awhile, I get a rather odd error which is 'twilight zone'
stuff.

The files are named in sequence, File1, File2, etc. and are transferred
into a directory.

Example scenario:

After moving the folder to hard drive, I delete all of the files and
leave only File2 in the directory. I try to rename File2 to be File1
(which was deleted) and it I get the 'file name already exists' error.

I copy the folder to a different USB drive from the hard drive. I take
it to ANOTHER machine, also running XP. Same problem on the other
machine, I cannot rename the file to one that used to exist in the
folder.

I run properties on the folder, it says it has 9 files (which it does
not, just 1).
I have "Show Hidden and System files" enabled in explorer, so they are
NOT system or hidden files.

Not hidden or system and not in use by another process since it was
moved to another machine and still sits on USB drive.

Weird.
 
W

Wesley Vogel

Try hitting the F5 key to refresh the folder.

refresh
To update displayed information with current data.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
P

Pegasus

I have an application which transfers files from portable usb device to
hard disk.
Once in awhile, I get a rather odd error which is 'twilight zone'
stuff.

The files are named in sequence, File1, File2, etc. and are transferred
into a directory.

Example scenario:

After moving the folder to hard drive, I delete all of the files and
leave only File2 in the directory. I try to rename File2 to be File1
(which was deleted) and it I get the 'file name already exists' error.

I copy the folder to a different USB drive from the hard drive. I take
it to ANOTHER machine, also running XP. Same problem on the other
machine, I cannot rename the file to one that used to exist in the
folder.

I run properties on the folder, it says it has 9 files (which it does
not, just 1).
I have "Show Hidden and System files" enabled in explorer, so they are
NOT system or hidden files.

Not hidden or system and not in use by another process since it was
moved to another machine and still sits on USB drive.

Weird.

Time to roll up your sleeves and do some work in a
Command Prompt environment! Do this:

1. Click Start / Run
2. Type cmd {OK}
3. Type these commands:
cd /d F:\SomeFolder {Enter}
(Use the correct drive letter and folder name where you are unable to rename
the file!)
attrib /d /s File1 | more {Enter}
(can you see File1?)
echo. > File1 {Enter}
(Does this create File1?)
 
R

roger

No. Not sure how that would do anything as it was moved from another
machine anyway, which would have loaded fresh when the USB drive was
plugged in.
This is a fundamental directory problem of some sort.

Do you know of a diagnostic tool that dumps raw directory information ?

BTW - I am a 15 year Windows software developer, never seen this one
before.
 
R

roger

attrib /d /s e:\mydir only shows folder names, not files.

If I try to redirect to the 'ghost' file it says "Access is denied."

One thing, I can run WinZip on the folder and it shows a bunch of files
that have attributes of Hidden System and Archive all set.
However, they are not viewable in explorer when enabling all of those
view settings.

Ok, I ran this and it showed one of the ghost files:
attrib -R -A -S -H File5

So the bits are all set but explorer dislikes showing them...
 
R

roger

I just ran attrib -R -A -S -H *.* /D /S and it woke up the files.

Not sure why explorer would not show the files, but don't care at this
point.

Thanks.
 
P

Pegasus

attrib /d /s e:\mydir only shows folder names, not files.

attrib /d /s shows folders AND files.

Glad you resolved your issue. However . . . if you
don't know what it was then it might come back
again. With your background in programming you
should be able to track it down from a Command
Prompt environment.
 
D

David Candy

Get a dos disk and use debug. Directories are files with a special attribute. Work out from the fat where it is and load the sectors.
 
B

billious

I just ran attrib -R -A -S -H *.* /D /S and it woke up the files.

Not sure why explorer would not show the files, but don't care at this
point.

Thanks.


The four most important words in microcomputing:

DOS Rules! Windows drools!

....Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top