X Tutup
Skip to content

Commit 4cc7ee0

Browse files
committed
리눅스에서 프로그램이 저장된 폴더를 가져오는 기능을 완성함
1 parent 2c6e8b9 commit 4cc7ee0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

SipPlatform/Directory.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,18 @@ char * CDirectory::GetProgramDirectory( )
355355
break;
356356
}
357357
}
358+
#else
359+
if( readlink( "/proc/self/exe", szDir, sizeof(szDir) ) != -1 )
360+
{
361+
for( int i = (int)strlen( szDir) - 1; i >= 0; i-- )
362+
{
363+
if( szDir[i] == '/' )
364+
{
365+
szDir[i] = '\0';
366+
break;
367+
}
368+
}
369+
}
358370
#endif
359371
}
360372

0 commit comments

Comments
 (0)
X Tutup