将文件从一个位置移至窗口C 的另一个位置
Move file from one location to another location in window c++
使用窗口10 Visual Studio C 2015将文件移至另一个位置的简单代码。在窗口中,如何将文件从一个位置移动到另一个位置。
我在位置d: data.txt上有一个文本文件。我想将其散失更改为c: total data data.txt。
#include <cstdio>
int main (void)
{
std::rename ("old_name", "new_name");
return 0;
}
我已经使用重命名的futine用于使用移动,但它不起作用的更多详细信息https://bytes.com/topic/c/answers/132322-file-move-move-programathine
我想更改文件的位置。
更改旧名称指定的文件或目录的名称。如果OldName和NewName指定了不同的路径,并且系统支持该路径,则文件将移至新位置。
#include <stdio.h>
int main ()
{
int result;
char oldname[] ="D:\data.txt";
char newname[] ="C:\datadull\newname.txt";
result= rename( oldname , newname );
if ( result == 0 )
puts ( "File successfully renamed" );
else
perror( "Error renaming file" );
return 0;
}
相关文章:
- glfw 在创建之前/创建时实例化窗口位置
- Win32 C++ 将窗口位置设置为右下角
- QT:即使在static_cast后也无法在主窗口中设置对象的位置
- 恢复Qt窗口大小和位置问题
- 获取窗口中的鼠标位置
- 如何以编程方式更改基于对话框的窗口的大小和位置?
- 在qt中更改show()上的窗口位置
- SFML参考窗口在绝对位置绘制
- 如何在Mac OSX上的窗口客户端内获取真实的鼠标位置?
- 如何在应用程序窗口中设置光标位置?(C )
- 如何设置GLFW窗口的(0,0)坐标位置
- 将文件从一个位置移至窗口C 的另一个位置
- 如何在主窗口.ui界面的特定位置设置QSpinBox
- SDL2切换全屏:窗口位置重置
- C :使用全局鼠标钩的窗口重新位置
- 在DOS窗口中的任何位置写入
- 窗口多个显示器位置
- Gtkmm - 固定窗口的位置?
- 如何在使用网格布局时重叠qwidgets,并将重叠的widget定位在距离窗口边界特定距离的位置
- Win32 C++-检查窗口位置X/PositionY和宽度/高度是否已更改