Discussion:
Locating Bad Filenames
(too old to reply)
j***@myplace.com
2011-03-25 08:55:46 UTC
Permalink
Is there some sort of software to locate files with bad filenames?

I dont understand this. I had some websites that I had saved, and
they ended up having rediculously long names. (Yea, I know I should
check that before I save them). Anyhow, they were saved to my "SAVE"
folder. Windows did not pop up any screen to tell me these were
invalid names at the time. Even more weird, these were saved in my I:
partition. (I have 6 partitions on two drives). I then moved these
files to my H: partition (H:\WEBSAVE), which is where I put all
websites that I save. They moved with no problem.

Yesterday I decided it was time to do a complete backup to my external
USB harddrive. When I backup, I simply COPY all the files from each
partition to a folder on my backup drive. For example, C: goes to a
folder called CCC. D: goes to DDD, etc...

I went to drive H:, SELECT ALL, and COPY to HHH on the external drive.
I get this error telling me it can not do the copy.

So, one by one, I copy each folder from the root of H: to the backup,
until I finally get to one folder which will not copy. (which was
WEBSAVE). Then I have to begin copying each sub folder or individual
file until I find the ONE bad filename. Several hours later I find
the culprit. A HTML filename consisting of at least 300 characters.
It's just too damn long.

I rename it, and the problem is solved. I cna now copy that file, or
the entire contents of the partition without any more problems.

While this method works, it's very time consuming to copy individual
folders and files until I find the bad filename. OF course Windows
(both 98 and 2000) do not tell me what file is at fault. Heaven
forbid I did not have 6 partitions and would have to dig thru 6 times
as many files if all files were on one partition.

My question is this?
Is these some sort of program that I can download which will just
search an entire partition, or my entire computer, and locate bad
filenames, telling me the name and location of the problem file?
Someone must have written a piece of software for this....
If there is, please tell me where to get it.

One other thing, I dont understand
Why could I not copy these bad filenames to my external drive, yet I
could move it to another partition without any problems?

Yes, I tried both Win98se and Win2000 (dual boot), to copy that
partition, and both failed, giving me the error messsage.

AND, why did Windows allow me to save the files under bad names in the
first place?


This is not the first time I have encountered this problem. I've
learned to go to my WEBSAVE folder first, because some websites just
have stupid names. From now on I will pay closer attention to the
names when I save websites, but it still would be good to have some
software to locate them.

Thanks

jw
Steven Saunderson
2011-03-25 09:34:42 UTC
Permalink
Post by j***@myplace.com
Is there some sort of software to locate files with bad filenames?
My question is this?
Is these some sort of program that I can download which will just
search an entire partition, or my entire computer, and locate bad
filenames, telling me the name and location of the problem file?
Someone must have written a piece of software for this....
If there is, please tell me where to get it.
Not that I know of but I have a copy program which I could modify to
limit output file names to 256 chars. This might help you. Do you have
any of the silly named files for testing ?
Post by j***@myplace.com
One other thing, I dont understand
Why could I not copy these bad filenames to my external drive, yet I
could move it to another partition without any problems?
Yes, I tried both Win98se and Win2000 (dual boot), to copy that
partition, and both failed, giving me the error messsage.
I've had files where the path and name is close to 256 chars. If I try
to copy them to a directory the resultant name is greater than 256 chars
and this causes a problem. Perhaps this is what you're encountering.
Post by j***@myplace.com
AND, why did Windows allow me to save the files under bad names in the
first place?
Beats me but I've seen it too.

Cheers,
--
Steven
98 Guy
2011-03-25 12:21:10 UTC
Permalink
Post by j***@myplace.com
Is there some sort of software to locate files with bad filenames?
Don't multi-post your questions to individual newsgroups.

Cross-post them.

Multi-posting is improper usenet "netiquette".

By cross-posting, you start a *single* conversation that participants in
all groups can read and participate in.
Steven Saunderson
2011-03-25 12:40:14 UTC
Permalink
Post by j***@myplace.com
I went to drive H:, SELECT ALL, and COPY to HHH on the external drive.
I get this error telling me it can not do the copy.
Updating my last post:

The WIN32 structure loaded by directory search functions contains a 260
char filename field. This means the longest possible name is 259 chars
+ a null.

This doesn't include the path so it should be possible to have a long
path (say 250 chars) then a long name. The fully-qualified name would
be much longer than 259 chars.

The longest filename I can create (via file rename in Explorer) is 251
chars in the \TEMP directory. The full name is k:\temp\251 chars which
totals 259 chars. I can move this file to another directory (including
on a USB flash drive) so long as the full path is max 8 chars.

I haven't tested whether it's possible to get a longer name by getting a
program to do a CD to a directory with a long name and then creating a
file with a 259 char long name.

When you copy from drive H to x:\HHH\ you're increasing the length of
the fully-qualified name and I think this is why your copies are
failing. I'd say Windows allows the file to be created because the name
is valid but moving or copying is restricted to locations where the path
length is no longer than the source path.

HTH,
--
Steven
Loading...