Problem
AFPS will allow the same file to be written to the file share with mixed
case support. For example, you can have the file:aaa
AAA
aAa
aAA... etcTo fix the filenames to only be in lowercase the mixedcasesupport flag needs to be set.
This will ensure that any file being written from a Windows client will always be the same case.
If you turn this option on but don't convert the filenames to lower case you will not be able to see the uppercase files or folders. You may experience Microsoft Office problem writing files in uppercase complaining that .tmp "temporary" file is inaccessible as Microsoft Office will try to rename the existing file first.
Solution
For AFPS 3.5.2n:
---------------
This is done by changing the following line in the file "lanman.ini" in
/usr/net/servers/lanman:[ fsi ]
mixedcasesupport=noYou may wish to add:uniquesuffixlength=1So rather than using three chars as the unique separator for long
filenames use the NT standard of 1 char. For Example, Progra~1 instead
of Prog~efr. However, if you create a "Test Folder" it becomes:TESTFO~X instead of TESTFO~1For AFPS 4.0.2:
--------------
REGCONFIG=/usr/net/servers/lanman/bin/regconfig
PARAM=MixedCaseSupportFSPARAMS=SYSTEM/CurrentControlSet/Services/AdvancedServer/FileServiceParameters
echo "$PARAM before setting:"
$REGCONFIG -v $FSPARAMS $PARAM | cut -d ":" -f 3
$REGCONFIG $FSPARAMS $PARAM REG_DWORD 0
echo "$PARAM after setting:"
$REGCONFIG -v $FSPARAMS $PARAM | cut -d ":" -f 3
echo "Press RETURN"
read CONTMaking the Change:
-----------------
Then stop and start AFPS using the commands:# net stop server
# net start serverChanging Existing Files:
-----------------------
To convert all your existing files and folders from upper to lower case
run the script below.Note, this will create a file in your $HOME/tmp listing. Any conflicts and the file.<pid> will show the history of the commands run.
There, are many ways of doing this, but this script is provided as an example.
ONLY RUN THIS SCRIPT ON DIRECTORIES THAT ARE SHARED OUT BY AFPS.
ie. run "net share" to confirm.DO NOT RUN DIRECTLY UNDER THE "/" (root) DIRECTORY.
#!/bin/ksh
# ident "@(#) chcase"
# comment "@(#) Change The Case of Folders Below Current Location"
#
# Usage: $0
## Is this an AFPS Server ?
if [ ! -f /usr/net/servers/lanman/lanman.ini ]; then
echo "This is not an AFPS Server !"
exit 1
fi#
# Double Check what you are about to do
#
if [ $# -lt 1 ]; then
echo "\nDo you wish to continue with moving all files to lower case from
here onwards !\n"
pwd
echo "\n(Y/N) [Default=y] ? "
read CONT
if [ "${CONT}" = "" ]; then
CONT="Y"
fi
if [ "${CONT}" = "N" ] || [ "${CONT}" = "n" ]; then
exit 0
fi
else
if [ $1 != "/SURE" ]; then
echo "Usage : $0 /SURE"
exit 1
fi
fi
#
# From this Directory Downwards
#
DIR='.'#
# Create a File for any problems
#
if [ ! ${HOME}/tmp ]; then
mkdir -p ${HOME}/tmp
fi
rm -f ${HOME}/tmp/probs#
# Use -depth so Directories are at the end
#
find "${DIR}" -print -depth > ${HOME}/tmp/file.$$
cat ${HOME}/tmp/file.$$ | while read i
do
#
# This is the last file in the list
#
if [ "${i}" = "." ]; then
break
fi #
# Find the File Name at the End of the Rainbow
#
A=0
BREAKOUT=0
LASTFILE=""
DIRPATH=""
BUILDUP=""
while [ "${BREAKOUT}" = 0 ] ;
do
# set -xv
NEW=`expr $A + 1`
A=${NEW}
FILE=`echo "${i}" | cut -d "/" -f "${A}"`
#
# As we cut the file from the path add it to the buildup
# then when we reach the end we'll have a null
#
if [ "${FILE}" != "" ]; then
DIRPATH="${BUILDUP}${LASTFILE}"
BUILDUP="${DIRPATH}"
#
# Don't put a leading slash at the front of the path
#
if [ "${FILE}" != "." ]; then
LASTFILE="/${FILE}"
else
LASTFILE="${FILE}"
fi
else
#
# Right, we now know the file so we'll rename it
# to lower case
#
FILE="${LASTFILE}"
newname=`echo "${FILE}" | tr '[A-Z]' '[a-z]'`
#
# Do Nothing if the file is already in lower case
#
if [ "${FILE}" != "${newname}" ]; then
#
# Check that there already isn't an lower case file
#
if [ ! -e "${BUILDUP}${newname}" ]; then
if [ "${FILE}" != "/UAP" ] && [ "${FILE}" !=
"/PRINT" ]; then
echo "mv ${BUILDUP}${FILE}
${BUILDUP}${newname}"
mv "${BUILDUP}${FILE}"
"${BUILDUP}${newname}"
fi
else
#
# Check that this process hasn't been run
already
#
if [ ! -e "${BUILDUP}${newname}.upper" ]; then
echo "mv ${BUILDUP}${FILE}
${BUILDUP}${newname}.upper"
mv "${BUILDUP}${FILE}"
"${BUILDUP}${newname}.upper" >> ${HOME}/tmp/list.$$
else
echo "CAN NOT RENAME ${BUILDUP}${FILE}
to ${BUILDUP}${newname}.upper" >> ${HOME}/tmp/probs
fi
fi
fi
LASTFILE=""
DIRPATH=""
BUILDUP=""
BREAKOUT=1
fi
done
done See also
TA118010, "Where can I find the differences between the "lanman.ini" file, used to configure my AFPS 3.5.2n server, and the Registry Keys used by AFPS 4.0.2?"