Skip to content

Commit

Permalink
Allow recursive directory creation for the -od option
Browse files Browse the repository at this point in the history
  • Loading branch information
mourisl committed Mar 22, 2024
1 parent fecf711 commit d8621db
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "pthread.h"


char LIGHTER_VERSION[] = "Lighter v1.1.2" ;
char LIGHTER_VERSION[] = "Lighter v1.1.3" ;

char nucToNum[26] = { 0, -1, 1, -1, -1, -1, 2,
-1, -1, -1, -1, -1, -1, -1,
Expand Down Expand Up @@ -375,6 +375,16 @@ int main( int argc, char *argv[] )
}
else if ( !strcmp( "-od", argv[i] ) )
{
int j ;
for (j = 0 ; argv[i + 1][j] ; ++j)
{
if (argv[i + 1][j] == '/')
{
argv[i + 1][j] = '\0' ;
mkdir( argv[i + 1], 0700 ) ;
argv[i + 1][j] = '/' ;
}
}
mkdir( argv[i + 1], 0700 ) ;
reads.SetOutputDirectory( argv[i + 1] ) ;
++i ;
Expand Down

0 comments on commit d8621db

Please sign in to comment.