Click here to Skip to main content
15,915,501 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionVisual Studio Newer Version Pin
BlitzPackage3-Nov-06 4:13
BlitzPackage3-Nov-06 4:13 
AnswerRe: Visual Studio Newer Version Pin
toxcct3-Nov-06 4:48
toxcct3-Nov-06 4:48 
GeneralRe: Visual Studio Newer Version Pin
BlitzPackage3-Nov-06 4:49
BlitzPackage3-Nov-06 4:49 
GeneralRe: Visual Studio Newer Version Pin
toxcct3-Nov-06 4:52
toxcct3-Nov-06 4:52 
GeneralRe: Visual Studio Newer Version Pin
Waldermort3-Nov-06 5:06
Waldermort3-Nov-06 5:06 
GeneralRe: Visual Studio Newer Version Pin
Maximilien3-Nov-06 5:13
Maximilien3-Nov-06 5:13 
GeneralRe: Visual Studio Newer Version Pin
Waldermort3-Nov-06 5:23
Waldermort3-Nov-06 5:23 
Questionstat problems, or I don't understand how it works. Pin
Maximilien3-Nov-06 3:23
Maximilien3-Nov-06 3:23 
( on vs.net 2003, on WinXP )
I'm trying to validate a path on my machine.

I use SHBrowseForFolder to select a folder on my system, as a test, I select "My Document"

The path returned is "C:\Documents and Settings\me\My Documents" which is a valid path, if I copy this in an windows explorer, it goes to that folder.

In my code, I use stat to check the folder like this :

struct stat St;
int iRet = stat( sPath, &St );
if( iRet != 0 )
{
  perror( "Problem getting information" );
  switch (errno)
  {
    case ENOENT:
     printf("File %s not found.\n", sPath);
     break;
    case EINVAL:
     printf("Invalid parameter to _stat.\n");
     break;
    default:
     /* Should never be reached. */
     printf("Unexpected error in _stat.\n");
  }
}
//.... more code.


The problem I get is that stat return -1 for a lot of valid paths, and the error returned goes to the case default.

am I doing this wrong ?

Thanks.




Maximilien Lincourt
Your Head A Splode - Strong Bad

QuestionRe: stat problems, or I don't understand how it works. Pin
David Crow3-Nov-06 3:28
David Crow3-Nov-06 3:28 
AnswerRe: stat problems, or I don't understand how it works. Pin
Maximilien3-Nov-06 3:39
Maximilien3-Nov-06 3:39 
GeneralRe: stat problems, or I don't understand how it works. Pin
David Crow3-Nov-06 3:51
David Crow3-Nov-06 3:51 
GeneralRe: stat problems, or I don't understand how it works. Pin
Maximilien3-Nov-06 4:39
Maximilien3-Nov-06 4:39 
GeneralRe: stat problems, or I don't understand how it works. Pin
David Crow3-Nov-06 4:48
David Crow3-Nov-06 4:48 
AnswerRe: stat problems, or I don't understand how it works. Pin
Mila0253-Nov-06 3:43
Mila0253-Nov-06 3:43 
GeneralRe: stat problems, or I don't understand how it works. Pin
David Crow3-Nov-06 3:54
David Crow3-Nov-06 3:54 
GeneralRe: stat problems, or I don't understand how it works. Pin
Mila0253-Nov-06 3:56
Mila0253-Nov-06 3:56 
GeneralRe: stat problems, or I don't understand how it works. Pin
Maximilien3-Nov-06 3:59
Maximilien3-Nov-06 3:59 
QuestionRe: stat problems, or I don't understand how it works. Pin
David Crow3-Nov-06 4:38
David Crow3-Nov-06 4:38 
AnswerRe: stat problems, or I don't understand how it works. Pin
Maximilien3-Nov-06 4:40
Maximilien3-Nov-06 4:40 
GeneralRe: stat problems, or I don't understand how it works. Pin
David Crow3-Nov-06 4:59
David Crow3-Nov-06 4:59 
GeneralRe: stat problems, or I don't understand how it works. Pin
Maximilien3-Nov-06 5:11
Maximilien3-Nov-06 5:11 
Questionhow to copy file from source to destination in vc++? Pin
baldha rakesh3-Nov-06 3:09
baldha rakesh3-Nov-06 3:09 
AnswerRe: how to copy file from source to destination in vc++? Pin
Mila0253-Nov-06 3:20
Mila0253-Nov-06 3:20 
QuestionRe: how to copy file from source to destination in vc++? Pin
David Crow3-Nov-06 3:20
David Crow3-Nov-06 3:20 
QuestionIOCTL_NDIS_QUERY_GLOBAL_STATS not working for Vista Pin
pvn g3-Nov-06 2:29
pvn g3-Nov-06 2:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.