-/* $Id: create.c,v 1.7 2000/09/12 10:12:13 jean Exp $
+/* $Id: create.c,v 1.8 2000/12/05 17:12:16 jean Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
next = &string[0];
CHECKPOINT;
+ if(*next==0) // root
+ {
+ memset(Fcb->entry.Filename,' ',11);
+ Fcb->entry.FileSize=DeviceExt->rootDirectorySectors*BLOCKSIZE;
+ Fcb->entry.Attrib=FILE_ATTRIBUTE_DIRECTORY;
+ if (DeviceExt->FatType == FAT32)Fcb->entry.FirstCluster=2;
+ else Fcb->entry.FirstCluster=1;
+ //FIXME : is 1 the good value for mark root?
+ ParentFcb=Fcb;
+ Fcb=NULL;
+ }
+ else
+ {
while (TRUE)
{
CHECKPOINT;
Fcb = ParentFcb;
CHECKPOINT;
ParentFcb = Temp;
+ }
CHECKPOINT;
{
if(RequestedDisposition==FILE_CREATE
||RequestedDisposition==FILE_OPEN_IF
- ||RequestedDisposition==FILE_OVERWRITE_IF)
+ ||RequestedDisposition==FILE_OVERWRITE_IF
+ ||RequestedDisposition==FILE_SUPERSEDE)
{
CHECKPOINT;
Status=addEntry(DeviceExt,FileObject,RequestedOptions
-/* $Id: rw.c,v 1.10 2000/12/01 12:41:08 jean Exp $
+/* $Id: rw.c,v 1.11 2000/12/05 17:12:16 jean Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
FirstCluster=CurrentCluster;
DPRINT("DeviceExt->BytesPerCluster %x\n",DeviceExt->BytesPerCluster);
- if (ReadOffset >= Fcb->entry.FileSize)
+ if ( !(Fcb->entry.Attrib & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ if (ReadOffset >= Fcb->entry.FileSize)
{
return(STATUS_END_OF_FILE);
}
- if ((ReadOffset + Length) > Fcb->entry.FileSize)
+ if ((ReadOffset + Length) > Fcb->entry.FileSize)
{
Length = Fcb->entry.FileSize - ReadOffset;
}
+ }
+CHECKPOINT;
*LengthRead = 0;
/* FIXME: optimize by remembering the last cluster read and using if possible */
Temp = ExAllocatePool(NonPagedPool,DeviceExt->BytesPerCluster);
&Fcb->entry.UpdateTime);
Fcb->entry.AccessDate = Fcb->entry.UpdateDate;
- if (Fcb->entry.FileSize < WriteOffset+Length)
+ if (Fcb->entry.FileSize < WriteOffset+Length
+ && ! (Fcb->entry.Attrib & FILE_ATTRIBUTE_DIRECTORY))
{
Fcb->entry.FileSize = WriteOffset+Length;
/*