File indexing completed on 2025-05-11 08:24:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifdef HAVE_CONFIG_H
0018 #include "config.h"
0019 #endif
0020
0021 #include <errno.h>
0022 #include <stdio.h>
0023 #include <stdlib.h>
0024 #include <string.h>
0025 #include <rtems/libio_.h>
0026 #include <time.h>
0027
0028 #include "fat.h"
0029 #include "fat_fat_operations.h"
0030 #include "fat_file.h"
0031
0032 #include "msdos.h"
0033
0034
0035
0036
0037
0038 int
0039 msdos_rename(
0040 const rtems_filesystem_location_info_t *old_parent_loc,
0041 const rtems_filesystem_location_info_t *old_loc,
0042 const rtems_filesystem_location_info_t *new_parent_loc,
0043 const char *new_name,
0044 size_t new_namelen
0045 )
0046 {
0047 int rc = RC_OK;
0048 fat_file_fd_t *old_fat_fd = old_loc->node_access;
0049 fat_dir_pos_t old_pos = old_fat_fd->dir_pos;
0050
0051
0052
0053
0054
0055 rc = msdos_creat_node(new_parent_loc,
0056 FAT_HARD_LINK,new_name,new_namelen,S_IFREG,
0057 old_fat_fd);
0058 if (rc != RC_OK)
0059 {
0060 return rc;
0061 }
0062
0063
0064
0065
0066 rc = msdos_set_first_char4file_name(old_loc->mt_entry,
0067 &old_pos,
0068 MSDOS_THIS_DIR_ENTRY_EMPTY);
0069
0070 return rc;
0071 }