diff --git a/src/bin/ls/main.c b/src/bin/ls/main.c index 4f9a596..9cf517e 100644 --- a/src/bin/ls/main.c +++ b/src/bin/ls/main.c @@ -78,7 +78,7 @@ fread(dirEntry,fd->size,1,fd); pwd[0] = '/'; for (i=0;i<(fd->size/sizeof(struct directoryEntry));i++) { - if ((dirEntry[i].fileName[0] > 0) && (dirEntry[i].fileName[0] != ':')) { + if ((dirEntry[i].fileName[0] > 0) && (dirEntry[i].fileName[0] != '/')) { for (x=0;x<12;x++) { permsData[x] = '-'; } diff --git a/src/sys/ubixfs/directory.c b/src/sys/ubixfs/directory.c index b9791f5..d7f618e 100644 --- a/src/sys/ubixfs/directory.c +++ b/src/sys/ubixfs/directory.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.7 2004/06/28 23:12:58 reddawg + file format now container:/path/to/file + Revision 1.6 2004/06/04 13:20:22 reddawg ubixFSmkDir(): played with it a bit to see if it still worked @@ -120,15 +123,12 @@ struct directoryEntry *entry = 0x0; struct ubixFSInfo *fsInfo = fd->mp->fsInfo; - kprintf("Creating Directory: %s",directory); + //kprintf("Creating Directory: %s",directory); block = getFreeBlocks(1,fd); if (block != 0x0) { - kprintf("A\n"); dir = (struct directoryEntry *)kmalloc(blockByteSize); - kprintf("B\n"); entry = (struct directoryEntry *)kmalloc(sizeof(struct directoryEntry)); - kprintf("HMM?\n"); entry->startCluster = block; entry->size = blockByteSize; @@ -136,8 +136,8 @@ entry->permissions = 0xEAA; sprintf(entry->fileName,directory); - dir->attributes = typeDirectory; - sprintf(dir->fileName,"Test Entry"); + //dir->attributes = typeDirectory; + //sprintf(dir->fileName,"Test Entry"); fd->mp->device->devInfo->write(fd->mp->device->devInfo->info,dir,fd->mp->diskLabel->partitions[fd->mp->partition].pOffset+fsInfo->blockAllocationTable[block].realSector,blockSize); addDirEntry(entry,fd); diff --git a/src/sys/vfs/file.c b/src/sys/vfs/file.c index c6788d8..bc9cac1 100644 --- a/src/sys/vfs/file.c +++ b/src/sys/vfs/file.c @@ -83,23 +83,27 @@ ************************************************************************/ void sysMkDir(const char *path) { fileDescriptor *tmpFD = 0x0; + char tmpDir[1024]; char rootPath[256]; char *dir = 0x0,*mountPoint = 0x0; + char *tmp = 0x0; rootPath[0] = '\0'; dir = (char *)path; - while (strstr(path,"/")) { + if (strstr(path,":") == 0x0) { + sprintf(tmpDir,"%s%s",_current->oInfo.cwd,path); + dir = (char *)&tmpDir; + } + while (strstr(dir,"/")) { if (rootPath[0] == 0x0) sprintf(rootPath,"%s/",strtok(dir,"/")); else - sprintf(rootPath,"%s/%s",rootPath,strtok(dir,"/")); - dir = strtok(NULL,"\n"); + sprintf(rootPath,"%s%s/",rootPath,strtok(dir,"/")); + tmp = strtok(NULL,"\n"); + dir = tmp; } - if (strstr(path,":") == 0x0) { - sprintf(rootPath,_current->oInfo.cwd); - } - kprintf("rootPath: [%s]\n",rootPath); + //kprintf("rootPath: [%s]\n",rootPath); tmpFD = fopen(rootPath,"rb"); if (tmpFD->mp == 0x0) { @@ -109,7 +113,7 @@ fclose(tmpFD); - kprintf("Dir: %s,Mount Point: %s\n",dir,mountPoint); + //kprintf("Dir: %s,Mount Point: %s\n",dir,mountPoint); return; } @@ -164,7 +168,14 @@ path = strtok(NULL,"\n"); } else - path = file; + path = (char *)file; + + i = strlen(path); + if (i > 2) { + if (path[i-1] == '/') + path[i-1] = '\0'; + } + i = 0; if (mountPoint == 0x0) { tmpFd->mp = findMount("sys"); /* _current->oInfo.container; */ @@ -242,6 +253,9 @@ /*** $Log$ + Revision 1.7 2004/06/29 00:18:49 reddawg + Sub Dirs + Revision 1.6 2004/06/28 23:12:58 reddawg file format now container:/path/to/file