Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to check if a file exists #48

Open
alecava58 opened this issue Nov 8, 2023 · 5 comments
Open

How to check if a file exists #48

alecava58 opened this issue Nov 8, 2023 · 5 comments

Comments

@alecava58
Copy link

Hi,

I looked at the source code but I didn't find how to check if a file exists before reading.

Thanks

@KristofferStrube
Copy link
Owner

Hey @alecava58, the user can only select files that are present. You can indeed have a file handle for a file longer than the actual file lives. I will explore the exact behavior for this and ensure there is a way to discover if the file no longer exists.

@alecava58
Copy link
Author

Hi Kristoffer, thanks for quick reply.

What I'm looking for is a function like System.IO.File.Exists(filename) and if the function returns true upload the file in client memory.

@KristofferStrube
Copy link
Owner

You can't open arbitrary files. Only files that the user has directly opened or files present in directories that the user has chosen directly. In the directory case, you can very easily get a list of all files and folders in it and continue from there.

@alecava58
Copy link
Author

Ok. I understand.

Thanks for sharing your useful library.

@KristofferStrube
Copy link
Owner

I'm keeping this issue open to explore what exceptions we should get when trying to read a file that has been moved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants