Red Hat Bugzilla – Bug 807630
csprocessor complains about directory when *file* exists
Last modified: 2014-10-19 19:00:38 EDT
[jwulf@nitai scratch]$ csprocessor create Test_Book_Template
CSProcessor client version: 0.22.5
Loading configuration from /home/jwulf/.config/csprocessor.ini
Connecting to Skynet server: http://skynet.usersys.redhat.com:8080/TopicIndex/
ERROR: A directory already exists for the Content Specification. Please check the "/home/jwulf/public_html/scratch/Test_Book_Template" directory first and if it's correct, then use the --force option.
Test_Book_Template exists, but is actually the content spec file that I'm checking in.
[jwulf@nitai scratch]$ ls
Content_Spec_Processor_2 Content_Spec_Processor_2~ Content_Spec_Processor_Guide Docbook+RDFa Existing_Content_Spec Existing_Content_Spec_Tutorial Test_Book_Template
Not sure if there is a strategy to deal with this situation (other than telling people to name the content spec something else - or perhaps the Name[+1] approach); but maybe csprocessor could check if it's in fact a file or a directory and give an appropriate error.
"A file named Test_Book_Template exists here. You could move this file, or execute this command in another directory."
"A directory named Test_Book_Template already exists here. You could move this directory, execute this command in another directory, or overwrite the Test_Book_Template directory using the --force option."
OS: Fedora release 16 (Verne)
JAVA: java version "1.7.0_b147-icedtea"
OpenJDK Runtime Environment (fedora-2.1.fc16.1-x86_64)
OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)
Fixed in 0.22.6
Really you should be using identifying methods (ie filename extensions) but none the less I've done a fix.
The check wasn't checking if the output was a file or a directory.
An error message would be displayed on the create command if a file existed that had the same name as the output directory.
Make the check see if the output is a file or a directory. If its a directory print the error message, otherwise continue with the normal processing.
Note: there is no need to print an error message if the file exists. it is only relevant for directories.
Closing and setting as current release as no QA was performed by the original reporter. If there is still an issue with this bug still than please re-open it.