Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-14-2007, 10:34 AM
mikechops mikechops is offline
Senior Member
 
Join Date: Aug 2005
Posts: 2,168
Default Annoying programming question

This is for the HUD I wrote. Whenever I try to open a Absolute hand history file, whilst the client is running, I get a sharing exception. This code works with all the other clients I've come across.

try{
CFile tmpFile(fileName, CFile::modeRead | CFile::shareDenyNone );

FlushFileBuffers(tmpFile.m_hFile);

tmpFile.Seek(startAt, CFile::begin);
int sz = tmpFile.Read(pBuf, (long)length);
}
catch (CFileException *e)
{
e->Delete();
free (pBuf);
return NULL;
}

The annoying part is, I just got done writing the parser. Boring work but seems to work fine with 20k hands. I thought I was almost done with Absolute, but unless I can get some help, I can see figuring out a work-around is going to be a pain in the ass.
Reply With Quote
  #2  
Old 10-14-2007, 11:49 AM
freecard4all freecard4all is offline
Senior Member
 
Join Date: Apr 2007
Posts: 479
Default Re: Annoying programming question

just an idea: what about copying the hand history file to a new folder?
Reply With Quote
  #3  
Old 10-14-2007, 01:05 PM
Catyoul Catyoul is offline
Senior Member
 
Join Date: Oct 2005
Posts: 115
Default Re: Annoying programming question

It looks like Absolute specifically denies sharing when it opens the hand history files, just using shareDenyNone won't allow you to access it.

I'm pretty sure there has to be a workaround though. It often happens to me that media player classic or zoomplayer cannot open a file I'm still downloading with restricted sharing, but mplayer can usually open it fine. Although it's a little bit overkill and some search on that specific subject should give you the answer, mplayer is open-source if you really can't find a solution.
Reply With Quote
  #4  
Old 10-14-2007, 01:17 PM
mikechops mikechops is offline
Senior Member
 
Join Date: Aug 2005
Posts: 2,168
Default Re: Annoying programming question

[ QUOTE ]
just an idea: what about copying the hand history file to a new folder?

[/ QUOTE ]

You mean to make a copy of the file from within the program and then read that? Because it's a little impractical to keep copying by hand - especially if you are multi-tabling [img]/images/graemlins/smile.gif[/img] But how do I copy it if I can't read it in the first place?
Reply With Quote
  #5  
Old 10-14-2007, 02:37 PM
jukofyork jukofyork is offline
Senior Member
 
Join Date: Sep 2004
Location: Leeds, UK.
Posts: 2,551
Default Re: Annoying programming question

[ QUOTE ]
[ QUOTE ]
just an idea: what about copying the hand history file to a new folder?

[/ QUOTE ]

You mean to make a copy of the file from within the program and then read that? Because it's a little impractical to keep copying by hand - especially if you are multi-tabling [img]/images/graemlins/smile.gif[/img] But how do I copy it if I can't read it in the first place?

[/ QUOTE ]
Yep, the only temp fix I can think of is to make a temporary copy of the file using C's system() function, eg: system("copy src temp");

Juk [img]/images/graemlins/smile.gif[/img]
Reply With Quote
  #6  
Old 10-14-2007, 03:45 PM
mikechops mikechops is offline
Senior Member
 
Join Date: Aug 2005
Posts: 2,168
Default Re: Annoying programming question

Thx... I did a

CopyFile(fileName, "tmp", 0);

and that seemed to work.
Reply With Quote
  #7  
Old 10-15-2007, 09:12 AM
SixthSense SixthSense is offline
Senior Member
 
Join Date: Jun 2006
Posts: 642
Default Re: Annoying programming question

[ QUOTE ]
Thx... I did a

CopyFile(fileName, "tmp", 0);

and that seemed to work.

[/ QUOTE ]

Strange, why don't the sharing restrictions apply to Windows itself?
Reply With Quote
  #8  
Old 10-15-2007, 10:03 AM
hypermegachi hypermegachi is offline
Senior Member
 
Join Date: Oct 2004
Location: flop turn river
Posts: 565
Default Re: Annoying programming question

[ QUOTE ]
[ QUOTE ]
Thx... I did a

CopyFile(fileName, "tmp", 0);

and that seemed to work.

[/ QUOTE ]

Strange, why don't the sharing restrictions apply to Windows itself?

[/ QUOTE ]
since when did microsoft follow specifications?
Reply With Quote
  #9  
Old 10-15-2007, 12:58 PM
freecard4all freecard4all is offline
Senior Member
 
Join Date: Apr 2007
Posts: 479
Default Re: Annoying programming question

from my experience
"copy something.smh"
works every time because it doesn't need an access to the file.
It just copies bytes = it doesn't interfere with the file itself.
So as long as the user has "read" right he can copy it.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:41 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.