75
75
rcutils_get_cwd (char * buffer , size_t max_length )
76
76
{
77
77
#ifdef RCUTILS_NO_FILESYSTEM
78
+ (void ) buffer ;
79
+ (void ) max_length ;
78
80
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
79
81
return false;
80
82
#else
98
100
rcutils_is_directory (const char * abs_path )
99
101
{
100
102
#ifdef RCUTILS_NO_FILESYSTEM
103
+ (void ) abs_path ;
101
104
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
102
105
return false;
103
106
#else
117
120
rcutils_is_file (const char * abs_path )
118
121
{
119
122
#ifdef RCUTILS_NO_FILESYSTEM
123
+ (void ) abs_path ;
120
124
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
121
125
return false;
122
126
#else
136
140
rcutils_exists (const char * abs_path )
137
141
{
138
142
#ifdef RCUTILS_NO_FILESYSTEM
143
+ (void ) abs_path ;
139
144
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
140
145
return false;
141
146
#else
151
156
rcutils_is_readable (const char * abs_path )
152
157
{
153
158
#ifdef RCUTILS_NO_FILESYSTEM
159
+ (void ) abs_path ;
154
160
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
155
161
return false;
156
162
#else
173
179
rcutils_is_writable (const char * abs_path )
174
180
{
175
181
#ifdef RCUTILS_NO_FILESYSTEM
182
+ (void ) abs_path ;
176
183
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
177
184
return false;
178
185
#else
195
202
rcutils_is_readable_and_writable (const char * abs_path )
196
203
{
197
204
#ifdef RCUTILS_NO_FILESYSTEM
205
+ (void ) abs_path ;
198
206
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
199
207
return false;
200
208
#else
@@ -222,6 +230,9 @@ rcutils_join_path(
222
230
rcutils_allocator_t allocator )
223
231
{
224
232
#ifdef RCUTILS_NO_FILESYSTEM
233
+ (void ) left_hand_path ;
234
+ (void ) right_hand_path ;
235
+ (void ) allocator ;
225
236
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
226
237
return NULL ;
227
238
#else
@@ -245,6 +256,8 @@ rcutils_to_native_path(
245
256
rcutils_allocator_t allocator )
246
257
{
247
258
#ifdef RCUTILS_NO_FILESYSTEM
259
+ (void ) path ;
260
+ (void ) allocator ;
248
261
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
249
262
return NULL ;
250
263
#else
@@ -260,6 +273,8 @@ char *
260
273
rcutils_expand_user (const char * path , rcutils_allocator_t allocator )
261
274
{
262
275
#ifdef RCUTILS_NO_FILESYSTEM
276
+ (void ) path ;
277
+ (void ) allocator ;
263
278
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
264
279
return NULL ;
265
280
#else
288
303
rcutils_mkdir (const char * abs_path )
289
304
{
290
305
#ifdef RCUTILS_NO_FILESYSTEM
306
+ (void ) abs_path ;
291
307
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
292
308
return false;
293
309
#else
@@ -337,31 +353,24 @@ typedef struct dir_list_t
337
353
struct dir_list_t * next ;
338
354
} dir_list_t ;
339
355
356
+ #ifndef RCUTILS_NO_FILESYSTEM
340
357
static void free_dir_list (dir_list_t * dir_list , rcutils_allocator_t allocator )
341
358
{
342
- #ifdef RCUTILS_NO_FILESYSTEM
343
- RCUTILS_SET_ERROR_MSG ("not available filesystem" );
344
- #else
345
359
dir_list_t * next_dir ;
346
360
do {
347
361
next_dir = dir_list -> next ;
348
362
allocator .deallocate (dir_list -> path , allocator .state );
349
363
allocator .deallocate (dir_list , allocator .state );
350
364
dir_list = next_dir ;
351
365
} while (dir_list );
352
- #endif // _RCUTILS_NO_FILESYSTEM
353
366
}
354
367
355
368
static void remove_first_dir_from_list (dir_list_t * * dir_list , rcutils_allocator_t allocator )
356
369
{
357
- #ifdef RCUTILS_NO_FILESYSTEM
358
- RCUTILS_SET_ERROR_MSG ("not available filesystem" );
359
- #else
360
370
dir_list_t * next_dir = (* dir_list )-> next ;
361
371
allocator .deallocate ((* dir_list )-> path , allocator .state );
362
372
allocator .deallocate (* dir_list , allocator .state );
363
373
* dir_list = next_dir ;
364
- #endif // _RCUTILS_NO_FILESYSTEM
365
374
}
366
375
367
376
static rcutils_ret_t check_and_calculate_size (
@@ -371,10 +380,6 @@ static rcutils_ret_t check_and_calculate_size(
371
380
dir_list_t * dir_list ,
372
381
rcutils_allocator_t allocator )
373
382
{
374
- #ifdef RCUTILS_NO_FILESYSTEM
375
- RCUTILS_SET_ERROR_MSG ("not available filesystem" );
376
- return RCUTILS_RET_ERROR ;
377
- #else
378
383
// Skip over local folder handle (`.`) and parent folder (`..`)
379
384
if (strcmp (filename , "." ) == 0 || strcmp (filename , ".." ) == 0 ) {
380
385
return RCUTILS_RET_OK ;
@@ -410,8 +415,8 @@ static rcutils_ret_t check_and_calculate_size(
410
415
allocator .deallocate (file_path , allocator .state );
411
416
412
417
return RCUTILS_RET_OK ;
413
- #endif // _RCUTILS_NO_FILESYSTEM
414
418
}
419
+ #endif // _RCUTILS_NO_FILESYSTEM
415
420
416
421
rcutils_ret_t
417
422
rcutils_calculate_directory_size_with_recursion (
@@ -421,6 +426,10 @@ rcutils_calculate_directory_size_with_recursion(
421
426
rcutils_allocator_t allocator )
422
427
{
423
428
#ifdef RCUTILS_NO_FILESYSTEM
429
+ (void ) directory_path ;
430
+ (void ) max_depth ;
431
+ (void ) size ;
432
+ (void ) allocator ;
424
433
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
425
434
return RCUTILS_RET_ERROR ;
426
435
#else
@@ -495,6 +504,8 @@ rcutils_dir_iter_t *
495
504
rcutils_dir_iter_start (const char * directory_path , const rcutils_allocator_t allocator )
496
505
{
497
506
#ifdef RCUTILS_NO_FILESYSTEM
507
+ (void ) directory_path ;
508
+ (void ) allocator ;
498
509
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
499
510
return NULL ;
500
511
#else
566
577
rcutils_dir_iter_next (rcutils_dir_iter_t * iter )
567
578
{
568
579
#ifdef RCUTILS_NO_FILESYSTEM
580
+ (void ) iter ;
569
581
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
570
582
return false;
571
583
#else
596
608
rcutils_dir_iter_end (rcutils_dir_iter_t * iter )
597
609
{
598
610
#ifdef RCUTILS_NO_FILESYSTEM
611
+ (void ) iter ;
599
612
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
600
613
#else
601
614
if (NULL == iter ) {
@@ -625,6 +638,7 @@ rcutils_get_file_size(const char * file_path)
625
638
{
626
639
627
640
#ifdef RCUTILS_NO_FILESYSTEM
641
+ (void ) file_path ;
628
642
RCUTILS_SET_ERROR_MSG ("not available filesystem" );
629
643
return 0 ;
630
644
#else
0 commit comments