Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Leading spaces in file names

2 views
Skip to first unread message

teradactyl

unread,
May 19, 2005, 6:06:08 PM5/19/05
to
We are testing a backup and restore application. We are able to properly
backup the file names and name spaces. On restore we are having problems
with open/creat. The most common problem is filenames with leading
spaces, the files are created w/o the leading spaces. I tried FEcreat and
it didn't help. Is there a more appropriate function in CLIB or a way to
construct the name of the file before calling creat, such that we get the
desired result?

Thanks in advance,
Kris

Roger Thomas, Dev SysOp 22

unread,
May 20, 2005, 7:54:16 PM5/20/05
to
I've been unable to find any docs from Novell regarding the issue of
leading spaces, but I can say that any interface pre WIN32 is likely to
have issues as MS added the feature 'late' to their file systems. From some
basic testing I've done, much of even WIN 2000 can not handle leading spaces.

As for FEcreat, the API call dates back to NW3 which means that it was
developed to support the 8.3 file names of DOS 5.

Roger Thomas, Dev SysOp 22

"teradactyl" <kw...@teradactyl.com> wrote in message news:k58je.549$252...@prv-forum2.provo.novell.com...

Dmitry Mityugov, Developer Services SysOp 8

unread,
May 22, 2005, 3:14:37 AM5/22/05
to
Kris,

Cannot reproduce. When I run the program below with parameter "nssvol1:
123", it creates file " 123" without removing the leading space. Are you
sure your program is setting the correct source name space before creating
files?

#include <errno.h>
#include <fcntl.h>
#include <nwerrno.h>
#include <nwfileng.h>
#include <nwnspace.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

int main( int argc, char* argv[]) {
int handle;
if ( argc != 2) {
printf( "Usage: %s <file>\n", argv[ 0]);
return EXIT_FAILURE;
}
printf( "file = '%s'\n", argv[ 1]);
SetCurrentNameSpace( LONGNameSpace);
handle = FEsopen( argv[ 1], O_WRONLY|O_CREAT|O_TRUNC, SH_DENYRW, 0,
DELETE_FILE_ON_CREATE_BIT, PrimaryDataStream);
if ( handle == -1) {
printf( "FEsopen failed, errno = %d (%s), NetWareErrno = %d\n", errno,
strerror( errno), NetWareErrno);
return EXIT_FAILURE;
}
close( handle);
return EXIT_SUCCESS;
}

--
Dmitry Mityugov, Developer Services SysOp 8

Search these newsgroups for answers to similar questions:
http://developer.novell.com/ndk/devforums.htm
Search DevSup Samples and TIDs:
http://developer.novell.com/support/sample.htm
Search KnowledgeBase and manuals:
http://support.novell.com/search/kb_index.jsp
Search YES, Tested and Approved Products:
http://developer.novell.com/yessearch/Search.jsp
Search Samples and Projects at Novell Forge:
http://forge.novell.com

0 new messages