06 Dec, 2008, Tyche wrote in the 81st comment:
Votes: 0
Igabod said:
If it works then I should be able to copyover.

I'm sorry this..
if (!stat(EXE_FILE, &info))
ought to be..
if (stat(EXE_FILE, &info))

Igabod said:
I have everything I need in the right place don't I? What am I missing here?


If you mean the EXE_FILE, startup script, and the makefile all set correctly, I have no way of knowing that.
06 Dec, 2008, Littlehorn wrote in the 82nd comment:
Votes: 0
Tyche said:
Igabod said:
If it works then I should be able to copyover.

I'm sorry this..
if (!stat(EXE_FILE, &info))
ought to be..
if (stat(EXE_FILE, &info))

Igabod said:
I have everything I need in the right place don't I? What am I missing here?




If you mean the EXE_FILE, startup script, and the makefile all set correctly, I have no way of knowing that.


:devil:

Quote
The stat() function obtains information about the named file and writes it to the area pointed to by the buf argument. The path argument points to a pathname naming a file. Read, write or execute permission of the named file is not required, but all directories listed in the pathname leading to the file must be searchable. An implementation that provides additional or alternate file access control mechanisms may, under implementation-dependent conditions, cause stat() to fail. In particular, the system may deny the existence of the file specified by path.
06 Dec, 2008, Igabod wrote in the 83rd comment:
Votes: 0
That one little ! makes a huge difference. It does what it's supposed to do now. Thank you for your patience with me Tyche.
06 Dec, 2008, Tyche wrote in the 84th comment:
Votes: 0
Littlehorn said:
Quote
The stat() function obtains information about the named file and writes it to the area pointed to by the buf argument. The path argument points to a pathname naming a file. Read, write or execute permission of the named file is not required, but all directories listed in the pathname leading to the file must be searchable. An implementation that provides additional or alternate file access control mechanisms may, under implementation-dependent conditions, cause stat() to fail. In particular, the system may deny the existence of the file specified by path.


Yes, and execl(), fopen(), etal can also fail under alternative file access control mechanisms. :-)
25 Dec, 2008, Igabod wrote in the 85th comment:
Votes: 0
Here is what my makefile looks like now after all of Tyche's help. I only put this here to help people in the future with similar problems.

# $Id $

CC = gcc
RM = rm
EXE = merc.exe
PROF = -O -ggdb
CYGWIN = -DCYGWIN
ECHOCMD = echo -e
LIBS = -lcrypt

# The colors Duke! The COLORS!
D_RED = \e# $Id $

CC = gcc
RM = rm
EXE = merc.exe
PROF = -O -ggdb
CYGWIN = -DCYGWIN
ECHOCMD = echo -e
LIBS = -lcrypt

# The colors Duke! The COLORS!
D_RED = \e[0;31m
L_RED = \e[1;31m
D_BLUE = \e[0;34m
L_BLUE = \e[1;34m
D_GREEN = \e[0;32m
L_GREEN = \e[1;32m
L_GREY = \e[0;37m
L_WHITE = \e[1;37m
L_NRM = \e[0;00m
D_PURPLE = \e[0;35m
L_MAGENTA = \e[1;35m
D_BROWN = \e[0;33m
L_YELLOW = \e[1;33m
D_CYAN = \e[0;36m
L_CYAN = \e[1;36m

# Use these two lines to use crypt(), ie on Linux systems.
# C_FLAGS = $(PROF) -Wall
# L_FLAGS = $(PROF) -lcrypt

# Uncomment these two lines to use plaintext passwords.
# This is how you fix the 'crypt' linking errors!
L_FLAGS = $(PROF)
C_FLAGS = -Wall $(PROF) -DNOCRYPT -DQMFIXES

# Source Files
SRC_FILES := $(wildcard *.c)

# Backup Files
BCK_DIR = backup
BCK_FILES := $(BCK_DIR)/*

# Object Files
OBJ_DIR = obj
OBJ_FILES := $(patsubst %.c,$(OBJ_DIR)/%.o,$(SRC_FILES))

# Header Files need to find out where to put these in the make
H_FILES = $(wildcard *.h)

merc: $(OBJ_FILES)
@$(ECHOCMD) "$(L_BLUE)[- $(L_WHITE)Rebuilding MUD executable: $(L_GREEN)merc.exe$(L_BLUE) -]$(L_NRM)"
@$(ECHOCMD) "$(L_BLUE)[- $(L_YELLOW)**********$(L_CYAN)Compile Complete$(L_YELLOW)**********$(L_BLUE) -]$(L_NRM)"
@$(CC) $(L_FLAGS) -o $(EXE) $(OBJ_FILES) $(LIBS)

$(OBJ_DIR)/%.o: %.c $(H_FILES)
@$(ECHOCMD) "$(L_BLUE)–> $(L_WHITE)Compiling file: $(L_MAGENTA)$<$(L_BLUE) <–$(L_RED)"
@$(CC) $(C_FLAGS) -c -o $@ $<
@$(ECHOCMD) "$(L_BLUE)[- $(L_YELLOW)$<$(L_NRM) compiled $(L_GREEN)OK$(L_BLUE) -]$(L_NRM)"

clean:
@$(ECHOCMD) "$(L_BLUE)–> $(L_CYAN)Cleaning up for full make… $(L_BLUE)<– $(L_NRM)"
@$(RM) -f $(OBJ_FILES) $(EXE) ../area/old_$(EXE) ../area/$(EXE) *~ *.bak *.orig *.rej
@$(ECHOCMD) "$(L_BLUE)[- $(L_GREEN)done$(L_NRM). $(L_BLUE)-]$(L_NRM)"

install:
@$(ECHOCMD) "$(L_BLUE)**** $(L_CYAN)Updating Live Executable $(L_BLUE)****$(L_NRM)"
@$(RM) -f $../area/old_$(EXE)
@mv ../area/$(EXE) ../area/old_$(EXE)
@cp $(EXE) ../area/$(EXE)
@$(ECHOCMD) "$(L_GREEN)**** $(L_YELLOW)Live Executable Updated $(L_GREEN)****$(L_NRM)"

cleanup:
@$(ECHOCMD) "$(L_BLUE)–> $(L_CYAN)Making clean for backing up $(L_BLUE)<– $(L_NRM)"
@$(RM) -f $(OBJ_FILES) $(BCK_FILES) $(EXE) ../area/$(EXE) ../area/old_$(EXE) ../log/*.log *~ *.bak *.orig *.rej
@$(ECHOCMD) "$(L_BLUE)[- $(L_GREEN)Ready to make a backup now$(L_NRM). $(L_BLUE)-]$(L_NRM)"
[/code]

Not everybody will enjoy the colors but you can easily leave that out if you wish. Hopefully this helps someone out. One thing to note is that I have my object files in the obj directory to make the src directory less cluttered. the bck_files you can leave out if you don't put a backup directory inside your src for testing theories out like I do.
80.0/85