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

Incorrectly deleting files based on wildcard #16

Open
joelu22 opened this issue Mar 11, 2020 · 0 comments
Open

Incorrectly deleting files based on wildcard #16

joelu22 opened this issue Mar 11, 2020 · 0 comments

Comments

@joelu22
Copy link

joelu22 commented Mar 11, 2020

Hello,

When I try to delete a file in the Jupyter UI it accidentally deletes similarly named files. For example, when I delete file, it also deletes file1 and file2.

To recreate:
1.) Update bucketname in the below code
2.) Run code
3.) In the Jupyter UI, try to delete 'file' that was just created
Result: 'file', 'file1', and 'file2' are removed
Expected Result: just 'file' should be removed


import numpy
from tensorflow.python.lib.io import file_io
from datetime import datetime

bucketname = 'myBucket'

print(datetime.now())
f = file_io.FileIO('gs://' + bucketname + '/file', "w")
numpy.savetxt(f, numpy.array(['1','2','3']), delimiter=',', fmt='%s')
f.flush()
f.close()

print(datetime.now())
f = file_io.FileIO('gs://' + bucketname + '/file1', "w")
numpy.savetxt(f, numpy.array(['1','2','3']), delimiter=',', fmt='%s')
f.flush()
f.close()

print(datetime.now())
f = file_io.FileIO('gs://' + bucketname + '/file2', "w")
numpy.savetxt(f, numpy.array(['1','2','3']), delimiter=',', fmt='%s')
f.flush()
f.close()

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

1 participant