Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by paulfrance

  1. paulfrance

    client server communication

    What about something like encapsulating it in a struct with an ID integer?
  2. paulfrance

    Doing C++ home, C in school

    Try here:- http://www.icce.rug.nl/documents/cplusplus/ or Bruce Eckel's excellent free online Thinking in C++ books. http://maththinking.com/boat/languageBooksIndex.html These should offer you some insight into the differences and similarities between C and C++. paulf
  3. paulfrance

    Read a File Backwards?

    Thinking about it, don't read the file backwards a byte at a time, that would be too painful. If you don't know the length of a record, have a guess at the approximate size of 100 lines and seek back to there. Read the end of the file into a string and count the linebreaks. If there's less than...
  4. paulfrance

    Read a File Backwards?

    I don't think there are any built in mechanisms to do this but I'm sure its possible using some combination of the following:- open the file seek the end use tell to get the current file position If your records are fixed length deduct length x 100 in bytes from tell and then seek there and...
  5. paulfrance

    string to double cast operation..

    It is not possible to cast string to a double value in the way you suggest. However, you can convert it with the following function from <stdlib.h> double atof(const char *s) //ascii to float paulf
  6. paulfrance

    fooling me for ages....

    One thing I noticed is that this line:- $code =~ s/[category]/category/g; is probably meant to replace [category] with category but the [] symbols are used in regexs to group chars so try escaping them like so:- $code =~ s/\[category\]/category/g; paulf
  7. paulfrance

    do i need to worry about multiple scritpts accessing one file?

    Yes, you do need to worry. If you're using a unix type system you should lock the file with flock(<FILE_HANDLE>, 2), where 2 is exclusive lock. flock is only voluntary, and will only preserve the file form other scripts using flock as well. Un(f)lock with flock(<FILE_HANDLE>, 8) when you're...
  8. paulfrance

    Perl Script Delete Problem

    Well, I guess the permission thing is because the script that creates the directory is not leaving it in a state where it can be deleted by another script. In your file creation script after the point where it creates the directory try adding the line, (and create a log file while you're at...
  9. paulfrance

    Perl Script Delete Problem

    Sorry if I confused you with the logfile thing, it's really very simple. It just means open file where you can write stuff from your script. Then you can read them with in Notepad or whatever when your script has run to see what happened:- Add this line to the top of your deleteuser...
  10. paulfrance

    Perl Script Delete Problem

    Not sure what the problem is but you could try this to find out. Set up a logfile somewhere and have your script open it for write each time it runs. Modify your rmdir lines to be something like:- rmdir(&quot;$add_ntpath\\accounts\\$delete&quot;) or print LOG &quot;rmdir failed because...
  11. paulfrance

    This is my 3rd post for this problem..... must be a real challenge?

    I forgot to add that because the path is virtual it's not the full root path on your server but the path as if you're linking like an href. paulf
  12. paulfrance

    This is my 3rd post for this problem..... must be a real challenge?

    Tels This how we used to call our scripts with SSIs when I used to work for a dotcom. All our servers were Linux but it might be worth a try. <!--#include virtual=&quot;/cgi-bin/script.pl&quot;--> paulf
  13. paulfrance

    Double Hash?

    If my memory is correct I think you need another pair of braces {} around the hash in the second foreach:- sort keys %{ rt::states{$from_state}} paulf
  14. paulfrance

    This is my 3rd post for this problem..... must be a real challenge?

    Well, first off I don't know a thing about Windows web servers but have you tried any of the following:- i, Check that any simple SSI will work. <!--#echo var=&quot;SERVER_NAME&quot;--> for example. Maybe your server isn't configured to run SSIs. ii, Should there be a colon after the command...
  15. paulfrance

    Reading found information from a file

    Just as an aside. If you want to read a whole file in real quick you should consider undefining the line separator thus. { #brackets limit the scope of local local $/ = undef; $buffer = <IN>; #the whole will now be read here } paulf

Part and Inventory Search

Back
Top