0
これは私のコードです。 "。"だけでopendirを使うとうまくいきますが、/ hiddenを試してみるとstatは失敗します。隠しフォルダのファイルに対してstatが機能しないのですか、何か間違っていますか?隠しフォルダ内のファイルに失敗したStat()
direc = opendir("./.hidden");
if(direc ==NULL)
{
perror("opendir failed");
}
while((curr_file=readdir(direc)))
{
if((strcmp(curr_file->d_name,".")!=0 && strcmp(curr_file->d_name,"..")!=0))
{
strcpy(file_name,".");
strcat(file_name,"/");
strcat(file_name,curr_file->d_name);
if(stat(file_name,&statp))
{
perror("stat failed");
}
Ahh geeze。ええ、他のコードを変更していて、それを逃しただけでした。ダー!ありがとう。 –