bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Directory creation/copy problem in Windows client


From: David Reiter
Subject: Directory creation/copy problem in Windows client
Date: Mon, 22 Apr 2002 17:05:27 -0700 (PDT)

Hi,
 I am running into a problem when having cfengine copy over files
in a directory from a linux box. My setup is the following:

I have a /var/cfengine/rpms directory on the linux box. I want
any files that get put in that directory to be copied to the
windows box. I added the following lines:
 
directories:
 /var/cfengine/rpms

Then had lines in the copy: section to copy any changed files in
/var/cfengine/rpms over. 

What would happen when I tried was I would get log messages
saying creating directory /var/cfeninge/rpms then error
messages saying it didn't exist. When I looked in the 
filesystem (under cygwin) /var/cfengines/rpms was never created.
So the rpms in the directory never got copied over. After doing
some debugging I found out that it was actually creating 
c:\var\cfeninge\rpms, but then trying to copy the rpm files
to the cygwin /var/cfengine/rpms directory. 

 I traced the source of this problem to line 486 
      *spc = FILE_SEPARATOR;
For Windows FILE_SEPARATOR points to '\\' so as it was
checking the directories in MakeDirectoriesFor it was
using '\\' which then went out to the C: drive. I changed
the logic to save the first separator as it was parsing the
directory and use it as it created the dirs, which seems 
to have fixed the problem.

insert at line 454:
if (Path_File_Separator == '\0') Path_File_Separator = *sp;
then change 486 to:
*spc = Path_File_Separator;
and declare the variable
char Path_File_Separator='\0'; at the top of MakeDirectoriesFor()

Does this fix sound reasonable? Am I going to have problems with 
other windows paths? Was there are specific reason the directories
were being changed to \ ? Thanks for any information,

David.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]