[Developers] Patch File.
smadiraju at cct.lsu.edu
smadiraju at cct.lsu.edu
Wed Jun 22 16:37:17 CDT 2005
Hi all,
This patch file is the fix for bug 1864. It uses the stat function to test the
file passed as the executable to cactus exe. The stat function sets a buffer
and we test the contents of the buffer to see if the file passed is a
directory.
This is done by querying the st_mode parameter set by the stat command. We can
test if this parameter is pointing to a directory by doing a "bitwise and" with
0040000 which is the value of S_IFDIR. This constant is also present in Windows
but it is called _S_IFDIR. We can use a #ifdef around it to make it work in
windows. I have tested the above patch on MAC and Linux and it works. I don't
have the means to test it on windows. I think the only change needed if at all
would be to change the 0040000 to _S_IFDIR in windows. The stat.h is present on
all the platforms.
The patch makes sure that when a directory is passed as input instead of a .par
file, to the cactus executable it flags an error. If the fix is not present then
the directory input is accepted and nothing happens. The fix involves using the
stat function in C which fill a buffer with all the information about the file
that is passed. Then we use a S_ISDIR macro to test if the file name passed is
a directory. If it is a directory then an error is flagged.
Please test it on windows and apply.
Regards
Sasanka Madiraju
Graduate Student
CCT-CSC.
--- StripMime Report -- processed MIME parts ---
multipart/mixed
text/plain (text body -- kept)
application/octet-stream
---
More information about the Developers
mailing list