Comments (11)
use '\' in the path.
this should work
smb2_rename_async(smb2, "123\\abc.txt.tmp", "123\\abc.txt", smb2_rename_cb, NULL);
from libsmb2.
smb2_rename_async is buggy. Since this function tries to emulate posix it should
remap '/' to '' for you, but it doesn't.
Until I fix this bug you can use the workaround that @afedchin suggested.
smb2_unlink works as expected as does most other path paced calls since almost all calls will end up becomming a SMB2 Create + SMB2 + SMB2 close chain.
SMB2 Create does this remapping.
Rename is different since it uses a Set Info command to provide the new/old names.
This is why rename behaves differently to almost all other commands.
I will fix this bug in rename.
Thanks for testing and report.
from libsmb2.
@afedchin thanks, it works !
url = smb2_parse_url(smb2, "smb://[email protected]/share/abc/123.txt");
url->path == "abc/123.txt"
why url->path not "abc\\123.txt"
? I don't understand it well.
from libsmb2.
why url->path not "abc\123.txt" ? I don't understand it well.
because it's a path in an URL. SMB should use \
for paths. SMB path != URL path.
from libsmb2.
ok, but why this works:
smb2_unlink(smb2, "123/abc.txt");
I just feel confused ...
from libsmb2.
it seems like other apis accept /
, but smb2_rename_async
supports \
only ?
from libsmb2.
82cce4a addressed this for open function.
from libsmb2.
@sahlberg thanks :)
is there any chance to bring the sync version of rename ?
from libsmb2.
from libsmb2.
Hi, I'm on iOS and currently using the pre-compiled lib from https://github.com/amosavian/AMSMB2
I've tried to build myself via the script provided within that project, but no luck
Your fix seems ok. I'll let you know later if I have time to make the build success.
from libsmb2.
@laoyur please open an issue in AMSMB2 repository if you have any problem including failure to build.
from libsmb2.
Related Issues (20)
- Does libsmb2 support FSCTL_PIPE_TRANSCEIVE HOT 1
- Building shared library (configure --enable-shared ignored) HOT 3
- Very slow performance w/MacOS SMB server HOT 2
- Build for Apple Silicon arm64 (M1 / M2 / M3) ? HOT 1
- NetBIOS name resolution for hostnames? HOT 2
- ESP_PLATFORM is sys/poll.h, not poll.h. HOT 4
- Initialize p_syntax_id_t
- Hang and crash when disconnecting on Windows HOT 1
- libsmb2 Debian Package HOT 7
- A couple of questions: (mainly SMBv3 traffic generation) HOT 2
- When will the new version be released?
- smb2_opendir memory leak HOT 3
- Many issues running libsmb2 in the context of a fuse filesystem HOT 9
- Add support to Teensy Micro Controller HOT 2
- error when building for ESP HOT 3
- smb2_read with offset for random access HOT 6
- "Wrong signature in received PDU" under heavy multithreading
- Api support for SMB_QUERY_FS_SIZE_INFO? HOT 2
- Add support to lease and notify HOT 1
- Request for Supporting auth_verifier_co_t auth_verifier HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsmb2.