[comp.sys.ibm.pc] File creation error

pcl@ihlpf.ATT.COM (pcl) (03/02/89)

I encountered the following error when trying to copy 300 files (small size)
from harddisk to A: (1.2 meg floppy drive):

File creation error
      224 File(s) copied

"DIR A:" indicated there are still plenty of space left.  The PC is a
Compaq Portable-III running MS-DOS 3.3 (from Compaq).

Also, why the copying process is VERY slow (over 5 minutes)?

Thanks in advance!

att!ihlpf!pcl

shurr@cbnews.ATT.COM (Larry A. Shurr) (03/02/89)

In article <7852@ihlpf.ATT.COM> pcl@ihlpf.UUCP (pcl) writes:
>I encountered the following error when trying to copy 300 files (small size)
>from harddisk to A: (1.2 meg floppy drive):

>File creation error
>      224 File(s) copied

>"DIR A:" indicated there are still plenty of space left.  The PC is a
>Compaq Portable-III running MS-DOS 3.3 (from Compaq).

You have almost certainly tried to put more files in the root directory
than will fit.  The root directory of any MSDOS disk is fixed in size
and cannot be expanded.  Subdirectories may be expanded as with any other
DOS file, but directory operations on large subdirectories are really
ssssssssllllllllloooooooooowwwwwwwww... (large root directories are
pretty slow too).

>Also, why the copying process is VERY slow (over 5 minutes)?

Hmmm...  Floppy disk I/O in DOS is never particularly fast, especially
file writes.  The overhead of repeatedly reading the entire (rather
large in your case) directory looking for a duplicate filename before
making a new file entry for each new file plus the overhead of reading,
updating, and writing the file allocation table (FAT) for each new
cluster allocated to a file and written really adds up.

regards, Larry
-- 
Signed: Larry A. Shurr (att!cbnews!cbema!las or osu-cis!apr!las)
Clever signature, Wonderful wit, Outdo the others, Be a big hit! - Burma Shave
(With apologies to the real thing.  The above represents my views only.)

emb978@leah.Albany.Edu (Eric M. Boehm) (03/02/89)

In article <7852@ihlpf.ATT.COM>, pcl@ihlpf.ATT.COM (pcl) writes:
> I encountered the following error when trying to copy 300 files (small size)
> from harddisk to A: (1.2 meg floppy drive):
> 
> File creation error
>       224 File(s) copied
> 

Since the root directory is located on specific tracks on the disk, there is
a *PHYSICAL* limitation to the number of files that are allowed in the root
directory. For 360K diskettes, this is 112 files; for 1.2M, 224 files; most
hard disks, 512 files (some partitioning software allows you to adjust
this).

The answer is to create a subdirectory and put your files in that. A
subdirectory is just a special kind of file. Its size is only limited by the
available space on the disk. You should be able to put all 300 files in a
subdirectory as long as you don't exceed 1.2M.

Eric M. Boehm
EMB978@ALBNY1VX.BITNET
EMB978@LEAH.ALBANY.EDU

asgard@cpro.uucp (J.R. Stoner) (03/03/89)

In article <7852@ihlpf.ATT.COM>, pcl@ihlpf.ATT.COM (pcl) writes:
> I encountered the following error when trying to copy 300 files (small size)
> from harddisk to A: (1.2 meg floppy drive):
> File creation error
>       224 File(s) copied

You just kinda answered your own question.  The flop12 *format* lays only
that many directory entries in the *root* directory, which is a fixed-size
resource.  In order to make the flop12 store more than that many files you
must copy them into a subdirectory, not the root.  Subdirectories are laid
out using indirect blocks allocated from the FAT.

> "DIR A:" indicated there are still plenty of space left.  The PC is a
> Compaq Portable-III running MS-DOS 3.3 (from Compaq).

I don't doubt it.  Space don't enter into it.  You might have plenty of room
to *store* files but you don't have enough root directory entries to
*allocate* them.

> Also, why the copying process is VERY slow (over 5 minutes)?

That is an issue you must take up with Little Billy.
-- 
"To prevent having to tell fools to RTFM don't let on you WTFM in the first
place." - J.R. (May the Source be With You) Stoner
asgard@cpro.uucp	asgard@wotan.uucp	asgard@well.uucp
...decwrl!pacbell!cpro!asgard

jc58+@andrew.cmu.edu (Johnny J. Chin) (03/03/89)

"File creation error" usually means that the file you are trying to over-write
on the floppy disk is a Read-Only file.  Also, the copy command will terminate
as soon as it hits an error, so it will stop after encountering this one.

The copy command is slow because it reads on file into memory and then writes
that one file, and repeats this process for every file.  This is extremely
slow especially for lots of small files.  You may wish to try XCOPY, which is
located on you DOS diskette (v3 or higher).  XCOPY fills up memory with as
many files as it can hold and then writes them.  This speeds things up a bit.
      __________                                ___
     /          \                          /   /    /_/ / /\/
    _/  /   /   /                       __/.  /__  / / / / /
   /     /     /
  /           / 4730 Centre Ave. #412   ARPAnet: Johnny.J.Chin@andrew.cmu.edu
 /  -------  /  Pittsburgh, PA  15213   BITnet:  jc58@andrew
 \__________/   (412) 268-8936          UUCP: ...!harvard!andrew.cmu.edu!jc58
 Computer Dr.

Disclaimer:   The views expressed herein are STRICTLY my own, and not CMU's.

abcscnge@csuna.csun.edu (Scott "The Pseudo-Hacker" Neugroschl) (03/03/89)

In article <7852@ihlpf.ATT.COM> pcl@ihlpf.UUCP (pcl) writes:
]I encountered the following error when trying to copy 300 files (small size)
]from harddisk to A: (1.2 meg floppy drive):
]
]File creation error
]      224 File(s) copied
]
]"DIR A:" indicated there are still plenty of space left.  The PC is a
]Compaq Portable-III running MS-DOS 3.3 (from Compaq).

My guess is at this point you run out of space in the root directory.
Try making a subdirectory and copying into that.  Subdirectories can
have as many entries as needed.

]Also, why the copying process is VERY slow (over 5 minutes)?
If you are using COPY, then it reads each file then writes each file.
Try using XCOPY.  It buffers as much into memory as it can and then
writes it out.  MUCH faster than COPY.  Has lots of nice options too...


-- 
Scott "The Pseudo-Hacker" Neugroschl
UUCP:  ...!sm.unisys.com!csun!csuna.csun.edu!abcscnge
-- "Beat me, whip me, make me code in Ada"
-- Disclaimers?  We don't need no stinking disclaimers!!!

james@bigtex.cactus.org (James Van Artsdalen) (03/03/89)

In <7852@ihlpf.ATT.COM>, pcl@ihlpf.UUCP (pcl) wrote:
> I encountered the following error when trying to copy 300 files (small size)
> from harddisk to A: (1.2 meg floppy drive):

> [...]

> Also, why the copying process is VERY slow (over 5 minutes)?

Several people pointed out that the root directory on a hard or floppy
disk is of a fixed and limited size, whereas a subdirectory could have
grown.  But no one pointed out a potential cause of slowness: lack of
buffers.

Mess-DOS uses the config.sys BUFFERS= mainly for directory sectors so
it doesn't have to re-read them constantly.  pcl's 224 files
constitutes 14 sectors worth of directory.  Towards the end, every
file added meant that all preceding N sectors of directory had to be
read linearly.  Once N exceeds the number of buffers, each and every
directory sector must be physically read.  In this case we would want
the config.sys BUFFERS= entry to be at least 2*N, so that we could
hold the source and destination directories entirely within RAM.

Another part of the problem is this: If 300 files were indeed intended
to fit in a 1.2meg disk, then the average file size was 4K or less.
But for files residing on the 8th directory block or later, DOS had to
read more than 4K of directory entries.  Hence the mere size of the
directory made the disk access very much slower, because the amount of
directory reading could exceed the amount of file reading.
-- 
James R. Van Artsdalen          james@bigtex.cactus.org   "Live Free or Die"
DCC Corporation     9505 Arboretum Blvd Austin TX 78759         512-338-8789

swh@hpsmtc1.HP.COM (Steve Harrold) (03/04/89)

Re: Slow COPY to floppy

The reason that COPYing a lot of files to floppy takes a long time is
because the directory on the floppy has to be sequentially searched every
time a new file is added, to guard against duplicate file names.

Since the original sector/cluster allocation for the directory was probably
insufficient to accomodate the hundreds of file names, it was automatically
extended everytime it filled up.  Because you were allocating clusters for
the files being copied, the directory extensions are not adjacent to the
original directory clusters.  This means the directory is fragmented.

Now, take the case of the last file that was COPYed.  The file system
started searching the directory for a possible hit, and caused the
seek arm of the floppy to go all over the place as it serially searched
that directory.  Only then did the copy operation proceed (after yet
another seek) and then the file was closed.  During the close, the directory
was searched again to find the entry so that the new filesize field could
be updated.  A lot more seeks thus occur.

In short, most of the I/O time on the floppy was spent seeking, not writing.

To speed things up, consider COPYing to multiple directories on the floppy.

huilin@hpindda.HP.COM (Hui Lin Lim) (03/04/89)

/ pcl@ihlpf.ATT.COM (pcl) /  8:28 am  Mar  1, 1989 / writes:
> I encountered the following error when trying to copy 300 files (small size)
> from harddisk to A: (1.2 meg floppy drive):
> 
> File creation error
>       224 File(s) copied
> 
> "DIR A:" indicated there are still plenty of space left.  The PC is a
> Compaq Portable-III running MS-DOS 3.3 (from Compaq).
> 
It probably means that your directory is full since the root
directory is of a fixed size.  If you were to create a
subdirectory and copy the files in there you should have no
problems since subdirectories can grow to accomodate any number
of files.

Its probably slow since the heads have to seek back and forth
from the data area to the directory every time a file is created.
This can be sped up with the use of some disk caching programs.
I recall using one from Golden Bow some time back when DOS backup
used to create multiple files and it reduced the backup time
tremendously.  Note that not all cache floppy drives and even
those that do may do write thru's rather than posted writes.

Hope this helps!


Hui-Lin Lim
ARPA: huilin%hpinddf@hplabs.hp.com
UUCP: {ucbvax,hplabs}!hpinddf!huilin